Skip to content

Commit

Permalink
feat: export form schema (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
shaddollxz authored Aug 12, 2024
1 parent 901816e commit c894de2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://deno.land/x/deno/cli/schemas/config-file.v1.json",
"name": "@byzanteam/taihaku-schemas",
"version": "0.4.2",
"version": "0.4.3",
"exports": "./types/mod.ts",
"compilerOptions": {
"strict": true,
Expand Down
11 changes: 10 additions & 1 deletion types/ui_schema/form/mod.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { JSONSchema } from '../../primitive.ts'
import type { FieldType } from '../field.ts'
import type { ObjectData } from '../types.ts'
import type { ObjectLayout } from './layout.ts'
Expand Down Expand Up @@ -114,7 +115,7 @@ type FieldsUISchema<
: FieldUIOptions<T, TCustomUIOptionMap> // normal field
}

export type UISchema<
export type FormUISchema<
O extends ObjectData = ObjectData,
TCustomUIOptionMap extends UIOptionMap = Record<never, ObjectData>,
> =
Expand All @@ -128,3 +129,11 @@ export type {
}

export { AppearanceValue, type OptionColumns } from './ui_options.ts'

export type FormSchema<
TData extends ObjectData = ObjectData,
TCustomUIOptionMap extends UIOptionMap = Record<never, ObjectData>,
> = {
schema: JSONSchema
uiSchema?: FormUISchema<TData, TCustomUIOptionMap>
}
3 changes: 0 additions & 3 deletions types/ui_schema/table/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,6 @@ export type TableSchema<
TData extends ObjectData = ObjectData,
TCustomUIOptionMap extends UIOptionMap = Record<never, ObjectData>,
> = {
/** uniqueId of a schema */
id: string
name?: string
columns: {
/** column name */
[K in keyof TData]?: GenericField<K, FieldType>
Expand Down

0 comments on commit c894de2

Please sign in to comment.