export type ColumnStringType = "string" | "uri" | "image-uri" | "audio-uri" | "date" | "time" | "date-time" | "markdown" | "phone-number" | "email-address" | "emoji" | "duration"; export type GlideProps = { token: string; endpoint: string; endpointREST: string; clientID?: string; }; export type { RowOf } from "./Table"; export type ColumnType = ColumnStringType | "number" | "boolean"; export type ColumnSchemaEntry = { type: ColumnType; name?: string; }; export type ColumnSchema = Record; export type APIColumnSchema = { id: string; name: string; type: { kind: string; }; }; export type APITableSchema = { columns: APIColumnSchema[]; }; export type IDName = { id: string; name: string; }; type Pretty = { [K in keyof T]: T[K]; } & {}; export type RowIdentifiable = RowID | FullRow; type ColumnTypeToType = T extends ColumnStringType ? string : T extends "number" ? number : T extends "boolean" ? boolean : unknown; type ColumnTypeOrSchemaEntryToType = T extends ColumnType ? ColumnTypeToType : T extends ColumnSchemaEntry ? ColumnTypeToType : never; export type Row = Pretty; }>>; export type NullableRow = Pretty; }>>; export type RowID = string; export type FullRow = Pretty<{ $rowID: RowID; } & Row>; export type NullableFullRow = Pretty<{ $rowID: RowID; } & NullableRow>; export type Tokened = { token?: string; }; export interface TableProps extends Tokened { name?: string; app: string; table: string; columns: T; } export interface AppProps extends Tokened { id: string; name?: string; } export type Operator = "<" | "<=" | "=" | "!=" | ">=" | ">"; export type IsNull = "IS NULL" | "IS NOT NULL"; export type Order = "ASC" | "DESC"; type ValuePredicate = { column: keyof TRow; compare: Operator; other: keyof TRow | string | number; }; type NullPredicate = { column: keyof TRow; compare: IsNull; }; export type Predicate = ValuePredicate | NullPredicate; export interface ToSQL { toSQL(): string; } export interface Query extends ToSQL { orderBy(column: keyof TRow, order?: Order): Omit, TOmit | "orderBy">; where(column: keyof TRow, compare: Operator, other: keyof TRow | string | number): Omit & QueryOr, TOmit | "where">; where(column: keyof TRow, compare: IsNull): Omit & QueryOr, TOmit | "where">; limit(n: number): Omit, TOmit | "limit">; } export interface QueryAnd extends Query { and(column: keyof TRow, compare: Operator, other: keyof TRow | string | number): Omit, TOmit>; and(column: keyof TRow, compare: IsNull): Omit, TOmit>; } export interface QueryOr extends Query { or(column: keyof TRow, compare: Operator, other: keyof TRow | string | number): Omit, TOmit>; or(column: keyof TRow, compare: IsNull): Omit, TOmit>; } export interface AppManifest { theme_color: string; author: string; glidePWAAddToHead: string; display: string; description: string; icons: Icon[]; start_url: string; background_color: string; name: string; short_name: string; } interface Icon { sizes: string; src: string; purpose: string; type: string; }