@spaceone/design-system
Version:
SpaceONE Design System
34 lines (33 loc) • 1.75 kB
TypeScript
import { Ref } from '@vue/composition-api';
export interface Timestamp {
seconds: string;
nanos?: number;
}
export declare type Computed<T> = Readonly<Ref<Readonly<T>>>;
export declare type JsonSchemaType = 'string' | 'number' | 'object' | 'integer' | 'array' | 'null';
export interface JsonSchema<T extends JsonSchemaType = JsonSchemaType> {
type: T;
title?: string;
examples?: any[];
default?: any;
properties?: {
[id: string]: JsonSchema;
};
enum?: any[];
items?: JsonSchema;
required?: string[];
}
export declare const StringProperty: (label: string, required?: any, placeholder?: string | undefined, extra?: any) => JsonSchema<"string">;
export declare const IntegerProperty: (label: string, required?: any, placeholder?: string | undefined, extra?: any) => JsonSchema<"integer">;
export declare const ArrayProperty: (label: string, required?: any, placeholder?: string | undefined, itemType?: "string" | "number" | "object" | "array" | "integer" | "null" | undefined, extra?: any) => JsonSchema<"array">;
export declare class JsonSchemaObjectType implements JsonSchema<'object'> {
properties: any;
required: string[];
$async: boolean;
type: 'object';
constructor(properties?: any, required?: string[], $async?: boolean);
addStringProperty(name: string, label: string, required?: boolean, placeHolder?: string, extra?: any): void;
addEnumProperty(name: string, label: string, enumData: any[], required?: boolean, extra?: any): void;
addArrayProperty(name: string, label: string, required?: boolean, itemType?: JsonSchemaType, extra?: any): void;
addIntegerProperty(name: string, label: string, required?: boolean, placeHolder?: string, extra?: any): void;
}