UNPKG

3.24 kBTypeScriptView Raw
1import { ColumnConfigInput, EventPayload } from './proto/service_pb';
2export interface TreelabConfig {
3 token?: string;
4 endPoint?: string;
5}
6export interface AddColumnsDTO {
7 workspaceId: string;
8 coreId: string;
9 tableId: string;
10 columnConfigs: ColumnConfigInput.AsObject[];
11}
12export declare enum ColumnType {
13 TEXT = "TEXT",
14 RECORD_REFERENCE = "RECORD_REFERENCE",
15 NUMBER = "NUMBER",
16 MULTI_SELECT = "MULTI_SELECT",
17 SELECT = "SELECT",
18 FORMULA = "FORMULA",
19 MULTI_ATTACHMENT = "MULTI_ATTACHMENT",
20 LOOKUP = "LOOKUP"
21}
22export interface ColumnConfig {
23 type: ColumnType;
24 name: string;
25 order?: number;
26 visibility?: boolean;
27 foreignTableId?: string;
28 defaultNumber?: number;
29 precision?: number;
30 choices?: Choice[];
31 dateFormat?: string;
32 includeTime?: boolean;
33 timeFormat?: string;
34 useGMT?: boolean;
35}
36export interface Choice {
37 id: string;
38 name: string;
39 color: string;
40}
41export declare enum ViewType {
42 GRID = "GRID",
43 TIMELINE = "TIMELINE"
44}
45export interface Attachment {
46 name: string;
47 url: string;
48}
49export interface ForeignRowVisibleNameValue {
50 value: string;
51}
52export interface ForeignRowValue {
53 id: string;
54 visibleNameList: ForeignRowVisibleNameValue[];
55}
56export interface Value {
57 type: ColumnType;
58 text?: string;
59 foreignRowList?: ForeignRowValue[];
60 number?: number;
61 selectedItems?: Choice[];
62 selectedItem?: Choice;
63 attachments?: Attachment[];
64 dateTime?: string;
65}
66export interface Resource {
67 workspaceId: string;
68 coreId?: string;
69 tableId?: string;
70 viewId?: string;
71 columnId?: string;
72 dashboardId?: string;
73 branchId?: string;
74 rowId?: string;
75}
76export declare type EventCallback = (e: EventPayload.AsObject) => any;
77export declare type FilterFn = (value: any, index: number, array: any[]) => any;
78export declare type SortFn = (a: any, b: any) => number;
79export declare enum Color {
80 lightRed = "lightRed",
81 blue = "blue",
82 red = "red",
83 gray = "gray",
84 magenta = "magenta",
85 yellow = "yellow",
86 orange = "orange",
87 green = "green",
88 black = "black",
89 pink = "pink",
90 purple = "purple",
91 lightBlue = "lightBlue",
92 lightGray = "lightGray",
93 lightMagenta = "lightMagenta",
94 lightYellow = "lightYellow",
95 lightOrange = "lightOrange",
96 lightGreen = "lightGreen",
97 lightBlack = "lightBlack",
98 lightPink = "lightPink",
99 lightPurple = "lightPurple"
100}
101export declare enum Icon {
102 briefcase = "briefcase",
103 untitle = "untitle",
104 asterisk = "asterisk",
105 barChart = "barChart",
106 check = "check",
107 circleBlank = "circleBlank",
108 cloud = "cloud",
109 barcode = "barcode",
110 beaker = "beaker",
111 bell = "bell",
112 bolt = "bolt",
113 book = "book",
114 bug = "bug",
115 building = "building",
116 bullhorn = "bullhorn",
117 calculator = "calculator",
118 calendar = "calendar",
119 camera = "camera",
120 sun = "sun",
121 flow = "flow",
122 coffee = "coffee",
123 handUp = "handUp",
124 anchor = "anchor",
125 cogs = "cogs",
126 comment = "comment",
127 compass = "compass",
128 creditCard = "creditCard",
129 dashboard = "dashboard",
130 edit = "edit",
131 food = "food"
132}