export type ImageOrVideoMetadata = {
readonly height: number;
readonly width: number;
readonly previewUrl: string;
};
const StructSchema = Schema.Struct({
height: Schema.String.pipe(
Schema.compose(Schema.NumberFromString),
Schema.annotations({
identifier: "height",
message: (issue) => `Expected a number representing image or video height but got ${issue.actual}`,
}),
),
width: Schema.String.pipe(
Schema.compose(Schema.NumberFromString),
Schema.annotations({
identifier: "width",
message: (issue) => `Expected a number representing image or video width but got ${issue.actual}`,
}),
),
previewUrl: Schema.String.pipe(
Schema.annotations({
identifier: "previewUrl",
message: (issue) => `Expected a string representing image or video preview image URL but got ${issue.actual}`,
}),
),
});
export type ImageOrVideoMetadata = {
readonly height: number;
readonly width: number;
readonly previewUrl: string;
};
const StructSchema = Schema.Struct({
height: Schema.String.pipe(
Schema.compose(Schema.NumberFromString),
Schema.annotations({
identifier: "height",
message: (issue) => `Expected a number representing image or video height but got ${issue.actual}`,
}),
),
width: Schema.String.pipe(
Schema.compose(Schema.NumberFromString),
Schema.annotations({
identifier: "width",
message: (issue) => `Expected a number representing image or video width but got ${issue.actual}`,
}),
),
previewUrl: Schema.String.pipe(
Schema.annotations({
identifier: "previewUrl",
message: (issue) => `Expected a string representing image or video preview image URL but got ${issue.actual}`,
}),
),
});