-
Notifications
You must be signed in to change notification settings - Fork 452
Expand file tree
/
Copy pathglobal.d.ts
More file actions
81 lines (68 loc) · 2 KB
/
global.d.ts
File metadata and controls
81 lines (68 loc) · 2 KB
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
import type { OAuthHelpers } from "@cloudflare/workers-oauth-provider";
import type { ThemeName, ThemeRouterConfig } from "@/features/theme/registry";
import type {
Auth as AuthType,
Session as SessionType,
} from "@/lib/auth/auth.server";
import type { DB as DBType } from "@/lib/db";
import type { QueueMessage } from "@/lib/queue/queue.schema";
declare global {
interface PostProcessWorkflowParams {
postId: number;
isPublished: boolean;
publishedAt?: string;
isFuturePost?: boolean;
}
interface ScheduledPublishWorkflowParams {
postId: number;
publishedAt: string;
}
interface PostAutoSnapshotWorkflowParams {
postId: number;
quietWindowSeconds?: number;
}
interface CommentModerationWorkflowParams {
commentId: number;
}
interface ExportWorkflowParams {
taskId: string;
postIds?: Array<number>;
status?: "draft" | "published";
locale?: "zh" | "en";
}
interface ImportWorkflowParams {
taskId: string;
r2Key: string;
mode: "native" | "markdown";
locale?: "zh" | "en";
}
interface Env extends Cloudflare.Env {
POST_PROCESS_WORKFLOW: Workflow<PostProcessWorkflowParams>;
POST_AUTO_SNAPSHOT_WORKFLOW: Workflow<PostAutoSnapshotWorkflowParams>;
COMMENT_MODERATION_WORKFLOW: Workflow<CommentModerationWorkflowParams>;
SCHEDULED_PUBLISH_WORKFLOW: Workflow<ScheduledPublishWorkflowParams>;
EXPORT_WORKFLOW: Workflow<ExportWorkflowParams>;
IMPORT_WORKFLOW: Workflow<ImportWorkflowParams>;
OAUTH_PROVIDER?: OAuthHelpers;
QUEUE: Queue<QueueMessage>;
}
type DB = DBType;
type Auth = AuthType;
type Session = SessionType;
type BaseContext = {
env: Env;
};
type DbContext = BaseContext & {
db: DB;
};
type SessionContext = DbContext & {
auth: Auth;
session: Session | null;
};
type AuthContext = Omit<SessionContext, "session"> & {
session: Session;
};
const __APP_VERSION__: string;
const __THEME_NAME__: ThemeName;
const __THEME_CONFIG__: ThemeRouterConfig;
}