Open History to see the last commit
1import * as Schema from "effect/Schema";
2import { EnvironmentId } from "@t3tools/contracts";
3
4export const DraftComposerImageAttachmentSchema = Schema.Struct({
5 id: Schema.String,
6 previewUri: Schema.String,
7 type: Schema.Literal("image"),
8 name: Schema.String,
9 mimeType: Schema.String,
10 sizeBytes: Schema.Number,
11 dataUrl: Schema.String,
12 uploadedAttachmentId: Schema.optional(Schema.String),
13 uploadEnvironmentId: Schema.optional(EnvironmentId),
14});
15
16export const DraftComposerFileAttachmentSchema = Schema.Struct({
17 id: Schema.String,
18 type: Schema.Literal("file"),
19 name: Schema.String,
20 mimeType: Schema.String,
21 sizeBytes: Schema.Number,
22 fileUri: Schema.String,
23 uploadedAttachmentId: Schema.optional(Schema.String),
24 uploadEnvironmentId: Schema.optional(EnvironmentId),
25});
26
27export const DraftComposerAttachmentSchema = Schema.Union([
28 DraftComposerImageAttachmentSchema,
29 DraftComposerFileAttachmentSchema,
30]);