Skip to content

Instantly share code, notes, and snippets.

@wilcorrea
Created June 2, 2019 14:11
Show Gist options
  • Save wilcorrea/126a55e36421efe69eb35a91cf3f7639 to your computer and use it in GitHub Desktop.
Save wilcorrea/126a55e36421efe69eb35a91cf3f7639 to your computer and use it in GitHub Desktop.
import { CreateElement } from 'vue'
/**
* @interface {Field}
*/
export interface Field {
label?: string,
key?: string,
tableAvailable?: boolean
tableWidth?: string,
tableHeight?: string,
tableTextAlign?: string,
tableStyle?: Function,
tableFormatter?: FieldTableFormatter
formComponent?: string
formAttrs?: Record
formWidth?: number
formAvailable?: boolean
formHidden?: boolean
formDefault?: any
}
/**
* @interface {FieldTable}
*/
export interface FieldTable {
label: string,
key: string,
width: string,
height: string,
align: string,
type: string,
formatter: FieldTableFormatter,
stylish: Function,
}
/**
* @interface {FieldTableRenderer}
*/
export interface FieldTableRenderer {
h: CreateElement,
value: any,
record: any,
column: Field
}
/**
* @interface {FieldTableFormatter}
*/
export type FieldTableFormatter = (renderer: FieldTableRenderer) => any;
/**
* @interface {FieldForm}
*/
export interface FieldForm {
label: string,
key: string,
is: string,
width: number,
height: number,
hidden: boolean,
attrs: Record,
listeners: Record
}
/**
* @interface {FieldForms}
*/
export interface FieldForms {
[key: string]: FieldForm
}
/**
* @interface {Fields}
*/
export interface Fields {
[key: string]: Field
}
/**
* @interface {Record}
*/
export interface Record {
[key: string]: any
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment