-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathobdk.ts
163 lines (138 loc) · 3.28 KB
/
obdk.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
import { Application } from "./utils/application";
export type AudioContextState = "running" | "suspended" | "initial" | "closed";
export type AudioSourceState = "initial" | "playing" | "ended";
export type NavigationOption = "Folder" | "File";
export type NavigationItemOption = {
name: String;
type: NavigationOption;
path: string;
};
export interface AccessTokenResponse {
access_token: string;
token_type: string;
expires_in: number;
scope: string;
}
export type SpotifyImage = {
height: number;
width: number;
url: string;
};
export type NowPlaying = {
artist: string;
songTitle: string;
url: string;
previewUrl: string;
images: SpotifyImage[];
};
export type Url = `https://${string}`;
export type SpotifyConfig = {
authBase?: Url | string;
base?: Url | string;
clientId?: string;
clientSecret?: string;
refreshToken?: string;
};
export interface MusicIntegration {
ConfigOptions: SpotifyConfig;
extractColorPaletteFromImage(source: Url): Promise<any>;
getAccessToken(): Promise<AccessTokenResponse>;
getNowPlaying(): Promise<NowPlaying>;
}
export type Message = {
canvas: OffscreenCanvas;
dimension: {
width: number;
height: number;
};
};
export type Sections = "musings" | "essays" | "contact";
export type Genre = "musings" | "poetry" | "engineering";
export const WRITING_GENRES: Genre[] = ["engineering", "musings", "poetry"];
export type SiteMap = "listening" | "reading" | "blocks" | "writing";
export const applicationKey = Symbol() as InjectionKey<Application>;
export type BlocksConfig = {
token: string;
baseUrl: string;
};
export type ContentType =
| "paragraph"
| "heading_1"
| "heading_2"
| "heading_3"
| "heading_4"
| "heading_5"
| "heading_6"
| "bulleted_list_item"
| "quote"
| "text"
| "image"
| "code";
export type Content = {
archived: boolean;
created_by: Modified;
created_time: string;
has_children: boolean;
id: string;
last_edited_by: Modified;
last_edited_time: string;
object: string;
type: ContentType;
paragraph?: ContentObject;
quote?: ContentObject;
heading_1?: ContentObject;
heading_2?: ContentObject;
heading_3?: ContentObject;
heading_4: ContentObject;
heading_5?: ContentObject;
heading_6?: ContentObject;
bulleted_list_item?: ContentObject;
code?: ContentObject;
};
export type ContentObject = {
color?: string;
text?: any[];
};
export type Modified = {
object: string;
id: string;
};
export const STAGES = ["seed", "bud", "fruit"] as const;
export type Stage = (typeof STAGES)[number];
export type Source = "notion" | "local";
export interface HarmonizedArticle {
date: string;
title: string;
slug: string;
source: Source;
stage: Stage | string;
genre: string | undefined;
tags?: string[];
}
export interface Backlink {
title: string;
slug: string;
}
export type Segment = "ESSAYS" | "NOTES";
export interface Essay {
day: string;
year: string;
month: string;
title: string;
slug: string;
source: "local" | "notion";
genre: string;
tags: string[];
tagsString: string;
segment: Segment;
summary?: string;
}
export interface Artefact {
type: "photo" | "text" | "lab" | "project";
preview: string | Url;
content: string | Url;
title?: string;
previewWidth?: number;
previewHeight?: number;
date?: string;
}