diff options
author | bobzel <zzzman@gmail.com> | 2022-02-09 08:59:32 -0500 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2022-02-09 08:59:32 -0500 |
commit | a6d904bcd18a2c9962abfd9b5b325340f6b18b0d (patch) | |
tree | 32ab8f94e8f742d9303ec06029247931f1ab3895 /src/fields/Types.ts | |
parent | 66fb0e4bbf88a5e9bcb5869dd7c8b8a7714de024 (diff) |
speeding up rendering using bitmaps for webpages and other heavyweight docs.
Diffstat (limited to 'src/fields/Types.ts')
-rw-r--r-- | src/fields/Types.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/fields/Types.ts b/src/fields/Types.ts index 3d784448d..220a30fe4 100644 --- a/src/fields/Types.ts +++ b/src/fields/Types.ts @@ -3,6 +3,7 @@ import { List } from "./List"; import { RefField } from "./RefField"; import { DateField } from "./DateField"; import { ScriptField } from "./ScriptField"; +import { URLField, WebField, ImageField } from "./URLField"; export type ToType<T extends InterfaceValue> = T extends "string" ? string : @@ -91,6 +92,12 @@ export function DateCast(field: FieldResult) { export function ScriptCast(field: FieldResult, defaultVal: ScriptField | null = null) { return Cast(field, ScriptField, defaultVal); } +export function WebCast(field: FieldResult, defaultVal: WebField | null = null) { + return Cast(field, WebField, defaultVal); +} +export function ImageCast(field: FieldResult, defaultVal: ImageField | null = null) { + return Cast(field, ImageField, defaultVal); +} type WithoutList<T extends Field> = T extends List<infer R> ? (R extends RefField ? (R | Promise<R>)[] : R[]) : T; |