@prefecthq/prefect-ui-library
Version:
This library is the Vue and Typescript component library for [Prefect 2](https://github.com/PrefectHQ/prefect) and [Prefect Cloud 2](https://www.prefect.io/cloud/). _The components and utilities in this project are not meant to be used independently_.
37 lines (36 loc) • 2 kB
TypeScript
import { Simplify } from '../../types/utilities';
export declare const schemaTypes: readonly ["null", "string", "boolean", "integer", "number", "array", "object"], isSchemaType: (value: unknown) => value is "string" | "number" | "boolean" | "object" | "null" | "integer" | "array";
export type SchemaPropertyType = typeof schemaTypes[number];
export declare function isSchemaPropertyType<T extends SchemaPropertyType | undefined>(value: unknown, type: T): value is T;
export declare const isSchemaPropertyPrimitiveType: (value: unknown) => value is "string" | "number" | "boolean" | "integer";
export declare const schemaStringFormat: readonly ["date", "date-time", "password", "json-string"], isSchemaStringFormat: (value: unknown) => value is "date" | "date-time" | "password" | "json-string";
export type SchemaStringFormat = typeof schemaStringFormat[number];
export type SchemaDefinition = `#/definitions/${string}`;
export type SchemaProperties = Record<string, SchemaProperty>;
export type SchemaDefinitions = Record<string, SchemaProperty>;
export type SchemaProperty = {
position?: number;
blockTypeSlug?: string;
$ref?: SchemaDefinition;
anyOf?: SchemaProperty[];
allOf?: SchemaProperty[];
example?: string;
default?: unknown;
const?: unknown;
description?: string;
enum?: unknown[];
format?: SchemaStringFormat;
items?: SchemaProperty | SchemaProperty[];
prefixItems?: SchemaProperty[];
properties?: SchemaProperties;
required?: string[];
title?: string;
type?: SchemaPropertyType;
minItems?: number;
maxItems?: number;
};
export declare function isSchemaProperty(value: SchemaProperty | SchemaProperty[] | undefined): value is SchemaProperty;
export declare function isPropertyWith<TKey extends keyof SchemaProperty>(value: SchemaProperty, property: TKey): value is Simplify<SchemaProperty & Required<Pick<SchemaProperty, TKey>>>;
export type Schema = SchemaProperty & {
definitions?: SchemaDefinitions;
};