Skip to content

Commit

Permalink
feat(types): add Data
Browse files Browse the repository at this point in the history
  • Loading branch information
fjc0k committed Jul 6, 2020
1 parent afe90fd commit bc5cd7e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
14 changes: 14 additions & 0 deletions types/Data.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* 数据记录。
*/
export type DataRecord = Record<any, any>;

/**
* 数据字段。
*/
export type DataField<TRecord extends DataRecord> = keyof TRecord;

/**
* 数据。
*/
export type Data<TRecord extends DataRecord> = TRecord[];
4 changes: 4 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
CanvasBackgroundProps,
} from './CanvasProps';
import { Point } from './Point';
import { Data, DataRecord, DataField } from './Data';

declare namespace F2 {
export {
Expand All @@ -17,6 +18,9 @@ declare namespace F2 {
CanvasPointProps,
CanvasBackgroundProps,
Point,
Data,
DataRecord,
DataField,
};
}

Expand Down

0 comments on commit bc5cd7e

Please sign in to comment.