pocketbase-import/types/pocketbase.ts
michal-kapala 3c78bb2a1b url type added
+ support for `Url` columns
2023-06-28 02:16:09 +02:00

36 lines
695 B
TypeScript

/**
* All the Pocketbase types supported by this tool.
*/
export const POCKETBASE_TYPE = {
BOOL: "bool",
NUMBER: "number",
PLAIN_TEXT: "text",
EMAIL: "email",
JSON: "json",
DATETIME: "date",
URL: "url",
} as const;
type ObjectValues<T> = T[keyof T];
/**
* Supported Pocketbase data types.
*/
export type PocketbaseType = ObjectValues<typeof POCKETBASE_TYPE>;
/**
* A row type schema for column value parsing.
*/
export type PocketbaseRowSchema = {
[key: string]: PocketbaseType;
};
/**
* PocketBase system fields with autogenerated values that cannot be overriden (`base` collection type).
*/
export const POCKETBASE_SYSFIELD = [
"id",
"created",
"updated",
];