@layerfi/components 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +40 -0
- package/.prettierrc.json +21 -0
- package/README.md +114 -10
- package/dist/esm/index.js +2094 -526
- package/dist/esm/index.js.map +4 -4
- package/dist/index.d.ts +902 -188
- package/dist/index.js +2153 -605
- package/dist/index.js.map +4 -4
- package/dist/styles/index.css +1317 -317
- package/dist/styles/index.css.map +3 -3
- package/index.d.ts +1309 -0
- package/package.json +13 -18
package/dist/index.d.ts
CHANGED
|
@@ -1,40 +1,73 @@
|
|
|
1
1
|
declare module '@layerfi/components/api/layer/authenticate' {
|
|
2
2
|
import { OAuthResponse } from '@layerfi/components/types';
|
|
3
|
-
|
|
3
|
+
type AuthenticationArguments = {
|
|
4
|
+
appId: string;
|
|
5
|
+
appSecret: string;
|
|
6
|
+
authenticationUrl?: string;
|
|
7
|
+
scope: string;
|
|
8
|
+
};
|
|
9
|
+
export const authenticate: ({ appId, appSecret, authenticationUrl, scope, }: AuthenticationArguments) => () => Promise<OAuthResponse>;
|
|
10
|
+
export {};
|
|
4
11
|
|
|
5
12
|
}
|
|
6
13
|
declare module '@layerfi/components/api/layer/authenticated_http' {
|
|
7
|
-
export
|
|
14
|
+
export type HTTPVerb = 'get' | 'put' | 'post' | 'patch' | 'options' | 'delete';
|
|
15
|
+
export const get: <Return extends Record<string, unknown> = Record<string, unknown>, Params extends Record<string, string | undefined> = Record<string, string | undefined>>(url: (params: Params) => string) => (baseUrl: string, accessToken: string | undefined, options?: {
|
|
8
16
|
params?: Params | undefined;
|
|
9
17
|
} | undefined) => () => Promise<Return>;
|
|
10
|
-
export const
|
|
18
|
+
export const request: (verb: HTTPVerb) => <Return extends Record<string, unknown> = Record<string, unknown>, Body_1 extends Record<string, unknown> = Record<string, unknown>, Params extends Record<string, string | undefined> = Record<string, string | undefined>>(url: (params: Params) => string) => (baseUrl: string, accessToken: string | undefined, options?: {
|
|
19
|
+
params?: Params | undefined;
|
|
20
|
+
body?: Body_1 | undefined;
|
|
21
|
+
} | undefined) => Promise<Return>;
|
|
22
|
+
export const post: <Return extends Record<string, unknown> = Record<string, unknown>, Body_1 extends Record<string, unknown> = Record<string, unknown>, Params extends Record<string, string | undefined> = Record<string, string | undefined>>(url: (params: Params) => string) => (baseUrl: string, accessToken: string | undefined, options?: {
|
|
23
|
+
params?: Params | undefined;
|
|
24
|
+
body?: Body_1 | undefined;
|
|
25
|
+
} | undefined) => Promise<Return>;
|
|
26
|
+
export const put: <Return extends Record<string, unknown> = Record<string, unknown>, Body_1 extends Record<string, unknown> = Record<string, unknown>, Params extends Record<string, string | undefined> = Record<string, string | undefined>>(url: (params: Params) => string) => (baseUrl: string, accessToken: string | undefined, options?: {
|
|
11
27
|
params?: Params | undefined;
|
|
12
28
|
body?: Body_1 | undefined;
|
|
13
29
|
} | undefined) => Promise<Return>;
|
|
14
30
|
|
|
31
|
+
}
|
|
32
|
+
declare module '@layerfi/components/api/layer/balance_sheet' {
|
|
33
|
+
import { BalanceSheet } from '@layerfi/components/types';
|
|
34
|
+
export interface GetBalanceSheetParams {
|
|
35
|
+
businessId: string;
|
|
36
|
+
date: string;
|
|
37
|
+
}
|
|
38
|
+
export const getBalanceSheet: (_token: string, _params: {
|
|
39
|
+
params: GetBalanceSheetParams;
|
|
40
|
+
}) => () => BalanceSheet;
|
|
41
|
+
|
|
15
42
|
}
|
|
16
43
|
declare module '@layerfi/components/api/layer/bankTransactions' {
|
|
17
44
|
import { CategoryUpdate, BankTransaction, Metadata } from '@layerfi/components/types';
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
data?: BankTransaction[] | undefined;
|
|
22
|
-
meta?: Metadata | undefined;
|
|
45
|
+
export type GetBankTransactionsReturn = {
|
|
46
|
+
data?: BankTransaction[];
|
|
47
|
+
meta?: Metadata;
|
|
23
48
|
error?: unknown;
|
|
24
|
-
}
|
|
25
|
-
export
|
|
26
|
-
|
|
49
|
+
};
|
|
50
|
+
export interface GetBankTransactionsParams extends Record<string, string | undefined> {
|
|
51
|
+
businessId: string;
|
|
52
|
+
sortOrder?: 'ASC' | 'DESC';
|
|
53
|
+
sortBy?: string;
|
|
54
|
+
}
|
|
55
|
+
export const getBankTransactions: (baseUrl: string, accessToken: string | undefined, options?: {
|
|
56
|
+
params?: GetBankTransactionsParams | undefined;
|
|
57
|
+
} | undefined) => () => Promise<GetBankTransactionsReturn>;
|
|
58
|
+
export const categorizeBankTransaction: (baseUrl: string, accessToken: string | undefined, options?: {
|
|
59
|
+
params?: Record<string, string | undefined> | undefined;
|
|
27
60
|
body?: CategoryUpdate | undefined;
|
|
28
61
|
} | undefined) => Promise<{
|
|
29
62
|
data: BankTransaction;
|
|
30
|
-
|
|
63
|
+
errors: unknown;
|
|
31
64
|
}>;
|
|
32
65
|
|
|
33
66
|
}
|
|
34
67
|
declare module '@layerfi/components/api/layer/categories' {
|
|
35
68
|
import { Category } from '@layerfi/components/types';
|
|
36
|
-
export const getCategories: (accessToken: string | undefined, options?: {
|
|
37
|
-
params?: Record<string, string> | undefined;
|
|
69
|
+
export const getCategories: (baseUrl: string, accessToken: string | undefined, options?: {
|
|
70
|
+
params?: Record<string, string | undefined> | undefined;
|
|
38
71
|
} | undefined) => () => Promise<{
|
|
39
72
|
data: {
|
|
40
73
|
type: 'Category_List';
|
|
@@ -42,11 +75,26 @@ declare module '@layerfi/components/api/layer/categories' {
|
|
|
42
75
|
};
|
|
43
76
|
}>;
|
|
44
77
|
|
|
78
|
+
}
|
|
79
|
+
declare module '@layerfi/components/api/layer/chart_of_accounts' {
|
|
80
|
+
import { AccountAlternate, ChartOfAccounts, NewAccount } from '@layerfi/components/types';
|
|
81
|
+
export const getChartOfAccounts: (baseUrl: string, accessToken: string | undefined, options?: {
|
|
82
|
+
params?: Record<string, string | undefined> | undefined;
|
|
83
|
+
} | undefined) => () => Promise<{
|
|
84
|
+
data: ChartOfAccounts;
|
|
85
|
+
}>;
|
|
86
|
+
export const createAccount: (baseUrl: string, accessToken: string | undefined, options?: {
|
|
87
|
+
params?: Record<string, string | undefined> | undefined;
|
|
88
|
+
body?: NewAccount | undefined;
|
|
89
|
+
} | undefined) => Promise<{
|
|
90
|
+
data: AccountAlternate;
|
|
91
|
+
}>;
|
|
92
|
+
|
|
45
93
|
}
|
|
46
94
|
declare module '@layerfi/components/api/layer/profit_and_loss' {
|
|
47
95
|
import { ProfitAndLoss } from '@layerfi/components/types';
|
|
48
|
-
export const getProfitAndLoss: (accessToken: string | undefined, options?: {
|
|
49
|
-
params?: Record<string, string> | undefined;
|
|
96
|
+
export const getProfitAndLoss: (baseUrl: string, accessToken: string | undefined, options?: {
|
|
97
|
+
params?: Record<string, string | undefined> | undefined;
|
|
50
98
|
} | undefined) => () => Promise<{
|
|
51
99
|
data?: ProfitAndLoss | undefined;
|
|
52
100
|
error?: unknown;
|
|
@@ -55,40 +103,114 @@ declare module '@layerfi/components/api/layer/profit_and_loss' {
|
|
|
55
103
|
}
|
|
56
104
|
declare module '@layerfi/components/api/layer' {
|
|
57
105
|
export const Layer: {
|
|
58
|
-
authenticate: (
|
|
59
|
-
|
|
60
|
-
|
|
106
|
+
authenticate: ({ appId, appSecret, authenticationUrl, scope, }: {
|
|
107
|
+
appId: string;
|
|
108
|
+
appSecret: string;
|
|
109
|
+
authenticationUrl?: string | undefined;
|
|
110
|
+
scope: string;
|
|
111
|
+
}) => () => Promise<import("@layerfi/components/types").OAuthResponse>;
|
|
112
|
+
categorizeBankTransaction: (baseUrl: string, accessToken: string | undefined, options?: {
|
|
113
|
+
params?: Record<string, string | undefined> | undefined;
|
|
114
|
+
body?: import("@layerfi/components/types").CategoryUpdate | undefined;
|
|
115
|
+
} | undefined) => Promise<{
|
|
116
|
+
data: import("@layerfi/components/types").BankTransaction;
|
|
117
|
+
errors: unknown;
|
|
118
|
+
}>;
|
|
119
|
+
createAccount: (baseUrl: string, accessToken: string | undefined, options?: {
|
|
120
|
+
params?: Record<string, string | undefined> | undefined;
|
|
121
|
+
body?: import("@layerfi/components/types").NewAccount | undefined;
|
|
122
|
+
} | undefined) => Promise<{
|
|
123
|
+
data: import("@layerfi/components/types").AccountAlternate;
|
|
124
|
+
}>;
|
|
125
|
+
getBalanceSheet: (_token: string, _params: {
|
|
126
|
+
params: import("@layerfi/components/api/layer/balance_sheet").GetBalanceSheetParams;
|
|
127
|
+
}) => () => import("@layerfi/components/types").BalanceSheet;
|
|
128
|
+
getBankTransactions: (baseUrl: string, accessToken: string | undefined, options?: {
|
|
129
|
+
params?: import("@layerfi/components/api/layer/bankTransactions").GetBankTransactionsParams | undefined;
|
|
130
|
+
} | undefined) => () => Promise<import("@layerfi/components/api/layer/bankTransactions").GetBankTransactionsReturn>;
|
|
131
|
+
getCategories: (baseUrl: string, accessToken: string | undefined, options?: {
|
|
132
|
+
params?: Record<string, string | undefined> | undefined;
|
|
61
133
|
} | undefined) => () => Promise<{
|
|
62
134
|
data: {
|
|
63
135
|
type: "Category_List";
|
|
64
136
|
categories: import("@layerfi/components/types").Category[];
|
|
65
137
|
};
|
|
66
138
|
}>;
|
|
67
|
-
|
|
68
|
-
params?: Record<string, string> | undefined;
|
|
139
|
+
getChartOfAccounts: (baseUrl: string, accessToken: string | undefined, options?: {
|
|
140
|
+
params?: Record<string, string | undefined> | undefined;
|
|
69
141
|
} | undefined) => () => Promise<{
|
|
70
|
-
data
|
|
71
|
-
meta?: import("@layerfi/components/types").Metadata | undefined;
|
|
72
|
-
error?: unknown;
|
|
142
|
+
data: import("@layerfi/components/types").ChartOfAccounts;
|
|
73
143
|
}>;
|
|
74
|
-
getProfitAndLoss: (accessToken: string | undefined, options?: {
|
|
75
|
-
params?: Record<string, string> | undefined;
|
|
144
|
+
getProfitAndLoss: (baseUrl: string, accessToken: string | undefined, options?: {
|
|
145
|
+
params?: Record<string, string | undefined> | undefined;
|
|
76
146
|
} | undefined) => () => Promise<{
|
|
77
147
|
data?: import("@layerfi/components/types").ProfitAndLoss | undefined;
|
|
78
148
|
error?: unknown;
|
|
79
149
|
}>;
|
|
80
|
-
categorizeBankTransaction: (accessToken: string | undefined, options?: {
|
|
81
|
-
params?: Record<string, string> | undefined;
|
|
82
|
-
body?: import("@layerfi/components/types").CategoryUpdate | undefined;
|
|
83
|
-
} | undefined) => Promise<{
|
|
84
|
-
data: import("@layerfi/components/types").BankTransaction;
|
|
85
|
-
error: unknown;
|
|
86
|
-
}>;
|
|
87
150
|
};
|
|
88
151
|
|
|
89
152
|
}
|
|
90
153
|
declare module '@layerfi/components/api/util' {
|
|
91
|
-
export const formStringFromObject: (object:
|
|
154
|
+
export const formStringFromObject: (object: Record<string, string | number | boolean>) => string;
|
|
155
|
+
|
|
156
|
+
}
|
|
157
|
+
declare module '@layerfi/components/components/BalanceSheet/BalanceSheet' {
|
|
158
|
+
import React from 'react';
|
|
159
|
+
export const BalanceSheet: () => React.JSX.Element;
|
|
160
|
+
|
|
161
|
+
}
|
|
162
|
+
declare module '@layerfi/components/components/BalanceSheet/index' {
|
|
163
|
+
export { BalanceSheet } from '@layerfi/components/components/BalanceSheet/BalanceSheet';
|
|
164
|
+
|
|
165
|
+
}
|
|
166
|
+
declare module '@layerfi/components/components/BalanceSheetDatePicker/BalanceSheetDatePicker' {
|
|
167
|
+
import React from 'react';
|
|
168
|
+
type Props = {
|
|
169
|
+
value: Date;
|
|
170
|
+
onChange: React.ChangeEventHandler<HTMLInputElement>;
|
|
171
|
+
};
|
|
172
|
+
export const BalanceSheetDatePicker: ({ value, onChange }: Props) => React.JSX.Element;
|
|
173
|
+
export {};
|
|
174
|
+
|
|
175
|
+
}
|
|
176
|
+
declare module '@layerfi/components/components/BalanceSheetDatePicker/index' {
|
|
177
|
+
export { BalanceSheetDatePicker } from '@layerfi/components/components/BalanceSheetDatePicker/BalanceSheetDatePicker';
|
|
178
|
+
|
|
179
|
+
}
|
|
180
|
+
declare module '@layerfi/components/components/BalanceSheetRow/BalanceSheetRow' {
|
|
181
|
+
import React from 'react';
|
|
182
|
+
import { LineItem } from '@layerfi/components/types';
|
|
183
|
+
type Props = {
|
|
184
|
+
depth?: number;
|
|
185
|
+
maxDepth?: number;
|
|
186
|
+
lineItem?: LineItem | null;
|
|
187
|
+
variant?: string;
|
|
188
|
+
summarize?: boolean;
|
|
189
|
+
};
|
|
190
|
+
export const BalanceSheetRow: ({ lineItem, depth, maxDepth, variant, summarize, }: Props) => React.JSX.Element | null;
|
|
191
|
+
export {};
|
|
192
|
+
|
|
193
|
+
}
|
|
194
|
+
declare module '@layerfi/components/components/BalanceSheetRow/index' {
|
|
195
|
+
export { BalanceSheetRow } from '@layerfi/components/components/BalanceSheetRow/BalanceSheetRow';
|
|
196
|
+
|
|
197
|
+
}
|
|
198
|
+
declare module '@layerfi/components/components/BankTransactionListItem/BankTransactionListItem' {
|
|
199
|
+
import React from 'react';
|
|
200
|
+
import { BankTransaction } from '@layerfi/components/types';
|
|
201
|
+
type Props = {
|
|
202
|
+
dateFormat: string;
|
|
203
|
+
bankTransaction: BankTransaction;
|
|
204
|
+
isOpen: boolean;
|
|
205
|
+
toggleOpen: (id: string) => void;
|
|
206
|
+
editable: boolean;
|
|
207
|
+
};
|
|
208
|
+
export const BankTransactionListItem: ({ dateFormat, bankTransaction, isOpen, toggleOpen, editable, }: Props) => React.JSX.Element | null;
|
|
209
|
+
export {};
|
|
210
|
+
|
|
211
|
+
}
|
|
212
|
+
declare module '@layerfi/components/components/BankTransactionListItem/index' {
|
|
213
|
+
export { BankTransactionListItem } from '@layerfi/components/components/BankTransactionListItem/BankTransactionListItem';
|
|
92
214
|
|
|
93
215
|
}
|
|
94
216
|
declare module '@layerfi/components/components/BankTransactionRow/BankTransactionRow' {
|
|
@@ -101,7 +223,7 @@ declare module '@layerfi/components/components/BankTransactionRow/BankTransactio
|
|
|
101
223
|
toggleOpen: (id: string) => void;
|
|
102
224
|
editable: boolean;
|
|
103
225
|
};
|
|
104
|
-
export const BankTransactionRow: ({ dateFormat, bankTransaction, isOpen, toggleOpen, editable, }: Props) => React.JSX.Element;
|
|
226
|
+
export const BankTransactionRow: ({ dateFormat, bankTransaction, isOpen, toggleOpen, editable, }: Props) => React.JSX.Element | null;
|
|
105
227
|
export {};
|
|
106
228
|
|
|
107
229
|
}
|
|
@@ -117,6 +239,38 @@ declare module '@layerfi/components/components/BankTransactions/BankTransactions
|
|
|
117
239
|
declare module '@layerfi/components/components/BankTransactions/index' {
|
|
118
240
|
export { BankTransactions } from '@layerfi/components/components/BankTransactions/BankTransactions';
|
|
119
241
|
|
|
242
|
+
}
|
|
243
|
+
declare module '@layerfi/components/components/Button/Button' {
|
|
244
|
+
import React, { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
245
|
+
export enum ButtonVariant {
|
|
246
|
+
primary = "primary",
|
|
247
|
+
secondary = "secondary"
|
|
248
|
+
}
|
|
249
|
+
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
250
|
+
variant?: ButtonVariant;
|
|
251
|
+
leftIcon?: ReactNode;
|
|
252
|
+
rightIcon?: ReactNode;
|
|
253
|
+
iconOnly?: ReactNode;
|
|
254
|
+
}
|
|
255
|
+
export const Button: ({ className, children, variant, leftIcon, rightIcon, iconOnly, ...props }: ButtonProps) => React.JSX.Element;
|
|
256
|
+
|
|
257
|
+
}
|
|
258
|
+
declare module '@layerfi/components/components/Button/SubmitButton' {
|
|
259
|
+
import React, { ButtonHTMLAttributes } from 'react';
|
|
260
|
+
export interface SubmitButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
261
|
+
processing?: boolean;
|
|
262
|
+
disabled?: boolean;
|
|
263
|
+
error?: boolean | string;
|
|
264
|
+
active?: boolean;
|
|
265
|
+
iconOnly?: boolean;
|
|
266
|
+
}
|
|
267
|
+
export const SubmitButton: ({ active, className, processing, disabled, error, children, ...props }: SubmitButtonProps) => React.JSX.Element;
|
|
268
|
+
|
|
269
|
+
}
|
|
270
|
+
declare module '@layerfi/components/components/Button/index' {
|
|
271
|
+
export { Button, ButtonVariant } from '@layerfi/components/components/Button/Button';
|
|
272
|
+
export { SubmitButton } from '@layerfi/components/components/Button/SubmitButton';
|
|
273
|
+
|
|
120
274
|
}
|
|
121
275
|
declare module '@layerfi/components/components/CategoryMenu/CategoryMenu' {
|
|
122
276
|
import React from 'react';
|
|
@@ -126,14 +280,74 @@ declare module '@layerfi/components/components/CategoryMenu/CategoryMenu' {
|
|
|
126
280
|
bankTransaction: BankTransaction;
|
|
127
281
|
value: Category | undefined;
|
|
128
282
|
onChange: (newValue: Category) => void;
|
|
283
|
+
disabled?: boolean;
|
|
284
|
+
className?: string;
|
|
129
285
|
};
|
|
130
|
-
export const CategoryMenu: ({ bankTransaction, name, value, onChange, }: Props) => React.JSX.Element;
|
|
286
|
+
export const CategoryMenu: ({ bankTransaction, name, value, onChange, disabled, className, }: Props) => React.JSX.Element;
|
|
131
287
|
export {};
|
|
132
288
|
|
|
133
289
|
}
|
|
134
290
|
declare module '@layerfi/components/components/CategoryMenu/index' {
|
|
135
291
|
export { CategoryMenu } from '@layerfi/components/components/CategoryMenu/CategoryMenu';
|
|
136
292
|
|
|
293
|
+
}
|
|
294
|
+
declare module '@layerfi/components/components/ChartOfAccounts/ChartOfAccounts' {
|
|
295
|
+
import React from 'react';
|
|
296
|
+
export const ChartOfAccounts: () => React.JSX.Element;
|
|
297
|
+
|
|
298
|
+
}
|
|
299
|
+
declare module '@layerfi/components/components/ChartOfAccounts/index' {
|
|
300
|
+
export { ChartOfAccounts } from '@layerfi/components/components/ChartOfAccounts/ChartOfAccounts';
|
|
301
|
+
|
|
302
|
+
}
|
|
303
|
+
declare module '@layerfi/components/components/ChartOfAccountsNewForm/ChartOfAccountsNewForm' {
|
|
304
|
+
import React from 'react';
|
|
305
|
+
export const ChartOfAccountsNewForm: () => React.JSX.Element;
|
|
306
|
+
|
|
307
|
+
}
|
|
308
|
+
declare module '@layerfi/components/components/ChartOfAccountsNewForm/index' {
|
|
309
|
+
export { ChartOfAccountsNewForm } from '@layerfi/components/components/ChartOfAccountsNewForm/ChartOfAccountsNewForm';
|
|
310
|
+
|
|
311
|
+
}
|
|
312
|
+
declare module '@layerfi/components/components/ChartOfAccountsRow/ChartOfAccountsRow' {
|
|
313
|
+
import React from 'react';
|
|
314
|
+
import { Account } from '@layerfi/components/types';
|
|
315
|
+
type Props = {
|
|
316
|
+
account: Account;
|
|
317
|
+
depth?: number;
|
|
318
|
+
};
|
|
319
|
+
export const ChartOfAccountsRow: ({ account, depth }: Props) => React.JSX.Element;
|
|
320
|
+
export {};
|
|
321
|
+
|
|
322
|
+
}
|
|
323
|
+
declare module '@layerfi/components/components/ChartOfAccountsRow/index' {
|
|
324
|
+
export { ChartOfAccountsRow } from '@layerfi/components/components/ChartOfAccountsRow/ChartOfAccountsRow';
|
|
325
|
+
|
|
326
|
+
}
|
|
327
|
+
declare module '@layerfi/components/components/Container/Container' {
|
|
328
|
+
import React, { ReactNode } from 'react';
|
|
329
|
+
export interface ContainerProps {
|
|
330
|
+
name: string;
|
|
331
|
+
className?: string;
|
|
332
|
+
children: ReactNode;
|
|
333
|
+
}
|
|
334
|
+
export const Container: ({ name, className, children }: ContainerProps) => React.JSX.Element;
|
|
335
|
+
|
|
336
|
+
}
|
|
337
|
+
declare module '@layerfi/components/components/Container/Header' {
|
|
338
|
+
import React, { CSSProperties, ReactNode } from 'react';
|
|
339
|
+
export interface HeaderProps {
|
|
340
|
+
className?: string;
|
|
341
|
+
style?: CSSProperties;
|
|
342
|
+
children: ReactNode;
|
|
343
|
+
}
|
|
344
|
+
export const Header: React.ForwardRefExoticComponent<HeaderProps & React.RefAttributes<HTMLElement>>;
|
|
345
|
+
|
|
346
|
+
}
|
|
347
|
+
declare module '@layerfi/components/components/Container/index' {
|
|
348
|
+
export { Container } from '@layerfi/components/components/Container/Container';
|
|
349
|
+
export { Header } from '@layerfi/components/components/Container/Header';
|
|
350
|
+
|
|
137
351
|
}
|
|
138
352
|
declare module '@layerfi/components/components/ExpandedBankTransactionRow/ExpandedBankTransactionRow' {
|
|
139
353
|
import React from 'react';
|
|
@@ -141,8 +355,14 @@ declare module '@layerfi/components/components/ExpandedBankTransactionRow/Expand
|
|
|
141
355
|
type Props = {
|
|
142
356
|
bankTransaction: BankTransaction;
|
|
143
357
|
close?: () => void;
|
|
358
|
+
isOpen?: boolean;
|
|
359
|
+
asListItem?: boolean;
|
|
360
|
+
showSubmitButton?: boolean;
|
|
361
|
+
};
|
|
362
|
+
export type SaveHandle = {
|
|
363
|
+
save: () => void;
|
|
144
364
|
};
|
|
145
|
-
export const ExpandedBankTransactionRow:
|
|
365
|
+
export const ExpandedBankTransactionRow: React.ForwardRefExoticComponent<Props & React.RefAttributes<SaveHandle>>;
|
|
146
366
|
export {};
|
|
147
367
|
|
|
148
368
|
}
|
|
@@ -162,6 +382,49 @@ declare module '@layerfi/components/components/Hello/Hello' {
|
|
|
162
382
|
declare module '@layerfi/components/components/Hello/index' {
|
|
163
383
|
export { Hello } from '@layerfi/components/components/Hello/Hello';
|
|
164
384
|
|
|
385
|
+
}
|
|
386
|
+
declare module '@layerfi/components/components/Input/FileInput' {
|
|
387
|
+
import React from 'react';
|
|
388
|
+
export interface FileInputProps {
|
|
389
|
+
text?: string;
|
|
390
|
+
onUpload?: (file: File) => void;
|
|
391
|
+
}
|
|
392
|
+
export const FileInput: ({ text, onUpload }: FileInputProps) => React.JSX.Element;
|
|
393
|
+
|
|
394
|
+
}
|
|
395
|
+
declare module '@layerfi/components/components/Input/Input' {
|
|
396
|
+
import React, { HTMLProps } from 'react';
|
|
397
|
+
export const Input: ({ className, ...props }: HTMLProps<HTMLInputElement>) => React.JSX.Element;
|
|
398
|
+
|
|
399
|
+
}
|
|
400
|
+
declare module '@layerfi/components/components/Input/InputGroup' {
|
|
401
|
+
import React, { ReactNode } from 'react';
|
|
402
|
+
export interface InputGroupProps {
|
|
403
|
+
label?: string;
|
|
404
|
+
name?: string;
|
|
405
|
+
className?: string;
|
|
406
|
+
children?: ReactNode;
|
|
407
|
+
}
|
|
408
|
+
export const InputGroup: ({ label, name, className, children, }: InputGroupProps) => React.JSX.Element;
|
|
409
|
+
|
|
410
|
+
}
|
|
411
|
+
declare module '@layerfi/components/components/Input/index' {
|
|
412
|
+
export { Input } from '@layerfi/components/components/Input/Input';
|
|
413
|
+
export { InputGroup } from '@layerfi/components/components/Input/InputGroup';
|
|
414
|
+
export { FileInput } from '@layerfi/components/components/Input/FileInput';
|
|
415
|
+
|
|
416
|
+
}
|
|
417
|
+
declare module '@layerfi/components/components/Loader/Loader' {
|
|
418
|
+
import React, { ReactNode } from 'react';
|
|
419
|
+
export interface LoaderProps {
|
|
420
|
+
children?: ReactNode;
|
|
421
|
+
}
|
|
422
|
+
export const Loader: ({ children }: LoaderProps) => React.JSX.Element;
|
|
423
|
+
|
|
424
|
+
}
|
|
425
|
+
declare module '@layerfi/components/components/Loader/index' {
|
|
426
|
+
export { Loader } from '@layerfi/components/components/Loader/Loader';
|
|
427
|
+
|
|
165
428
|
}
|
|
166
429
|
declare module '@layerfi/components/components/Pill/Pill' {
|
|
167
430
|
import React, { PropsWithChildren } from 'react';
|
|
@@ -174,16 +437,18 @@ declare module '@layerfi/components/components/Pill/index' {
|
|
|
174
437
|
}
|
|
175
438
|
declare module '@layerfi/components/components/ProfitAndLoss/ProfitAndLoss' {
|
|
176
439
|
import React, { PropsWithChildren } from 'react';
|
|
177
|
-
import { useProfitAndLoss } from '@layerfi/components/hooks/useProfitAndLoss/index';
|
|
178
|
-
type PNLContextType = ReturnType<typeof useProfitAndLoss> & {
|
|
179
|
-
dimensions?: DOMRect;
|
|
180
|
-
};
|
|
181
440
|
const ProfitAndLoss: {
|
|
182
441
|
({ children }: PropsWithChildren): React.JSX.Element;
|
|
183
442
|
Chart: () => React.JSX.Element;
|
|
184
|
-
Context: React.Context<
|
|
443
|
+
Context: React.Context<{
|
|
444
|
+
data: import("@layerfi/components/types").ProfitAndLoss | undefined;
|
|
445
|
+
isLoading: boolean;
|
|
446
|
+
error: unknown;
|
|
447
|
+
dateRange: import("@layerfi/components/types").DateRange;
|
|
448
|
+
changeDateRange: (dateRange: Partial<import("@layerfi/components/types").DateRange>) => void;
|
|
449
|
+
}>;
|
|
185
450
|
DatePicker: () => React.JSX.Element;
|
|
186
|
-
Summaries: () => React.JSX.Element
|
|
451
|
+
Summaries: () => React.JSX.Element;
|
|
187
452
|
Table: () => React.JSX.Element;
|
|
188
453
|
};
|
|
189
454
|
export { ProfitAndLoss };
|
|
@@ -192,6 +457,17 @@ declare module '@layerfi/components/components/ProfitAndLoss/ProfitAndLoss' {
|
|
|
192
457
|
declare module '@layerfi/components/components/ProfitAndLoss/index' {
|
|
193
458
|
export { ProfitAndLoss } from '@layerfi/components/components/ProfitAndLoss/ProfitAndLoss';
|
|
194
459
|
|
|
460
|
+
}
|
|
461
|
+
declare module '@layerfi/components/components/ProfitAndLossChart/Indicator' {
|
|
462
|
+
import React from 'react';
|
|
463
|
+
import { Props as BaseProps } from 'recharts/types/component/Label';
|
|
464
|
+
type Props = BaseProps & {
|
|
465
|
+
animateFrom: number;
|
|
466
|
+
setAnimateFrom: (x: number) => void;
|
|
467
|
+
};
|
|
468
|
+
export const Indicator: ({ viewBox, className, animateFrom, setAnimateFrom, }: Props) => React.JSX.Element | null;
|
|
469
|
+
export {};
|
|
470
|
+
|
|
195
471
|
}
|
|
196
472
|
declare module '@layerfi/components/components/ProfitAndLossChart/ProfitAndLossChart' {
|
|
197
473
|
import React from 'react';
|
|
@@ -213,16 +489,16 @@ declare module '@layerfi/components/components/ProfitAndLossDatePicker/index' {
|
|
|
213
489
|
}
|
|
214
490
|
declare module '@layerfi/components/components/ProfitAndLossRow/ProfitAndLossRow' {
|
|
215
491
|
import React from 'react';
|
|
216
|
-
import { Direction } from '@layerfi/components/types';
|
|
217
|
-
import { LineItem } from '@layerfi/components/types/profit_and_loss';
|
|
492
|
+
import { Direction, LineItem } from '@layerfi/components/types';
|
|
218
493
|
type Props = {
|
|
219
494
|
variant?: string;
|
|
220
495
|
depth?: number;
|
|
221
496
|
maxDepth?: number;
|
|
222
497
|
lineItem?: LineItem | null;
|
|
223
498
|
direction?: Direction;
|
|
499
|
+
summarize?: boolean;
|
|
224
500
|
};
|
|
225
|
-
export const ProfitAndLossRow: ({ variant, lineItem, depth, maxDepth, direction, }: Props) => React.JSX.Element | null;
|
|
501
|
+
export const ProfitAndLossRow: ({ variant, lineItem, depth, maxDepth, direction, summarize, }: Props) => React.JSX.Element | null;
|
|
226
502
|
export {};
|
|
227
503
|
|
|
228
504
|
}
|
|
@@ -232,7 +508,7 @@ declare module '@layerfi/components/components/ProfitAndLossRow/index' {
|
|
|
232
508
|
}
|
|
233
509
|
declare module '@layerfi/components/components/ProfitAndLossSummaries/ProfitAndLossSummaries' {
|
|
234
510
|
import React from 'react';
|
|
235
|
-
export const ProfitAndLossSummaries: () => React.JSX.Element
|
|
511
|
+
export const ProfitAndLossSummaries: () => React.JSX.Element;
|
|
236
512
|
|
|
237
513
|
}
|
|
238
514
|
declare module '@layerfi/components/components/ProfitAndLossSummaries/index' {
|
|
@@ -243,57 +519,278 @@ declare module '@layerfi/components/components/ProfitAndLossTable/ProfitAndLossT
|
|
|
243
519
|
import React from 'react';
|
|
244
520
|
export const ProfitAndLossTable: () => React.JSX.Element;
|
|
245
521
|
|
|
522
|
+
}
|
|
523
|
+
declare module '@layerfi/components/components/ProfitAndLossTable/empty_profit_and_loss_report' {
|
|
524
|
+
import { ProfitAndLoss } from '@layerfi/components/types';
|
|
525
|
+
const _default: ProfitAndLoss;
|
|
526
|
+
export default _default;
|
|
527
|
+
|
|
246
528
|
}
|
|
247
529
|
declare module '@layerfi/components/components/ProfitAndLossTable/index' {
|
|
248
530
|
export { ProfitAndLossTable } from '@layerfi/components/components/ProfitAndLossTable/ProfitAndLossTable';
|
|
249
531
|
|
|
250
532
|
}
|
|
251
|
-
declare module '@layerfi/components/components/
|
|
252
|
-
import React from 'react';
|
|
253
|
-
type Props =
|
|
254
|
-
|
|
255
|
-
label: string;
|
|
256
|
-
name: string;
|
|
257
|
-
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
258
|
-
value: string;
|
|
259
|
-
disabled?: boolean;
|
|
260
|
-
size: 'small' | 'large';
|
|
261
|
-
};
|
|
262
|
-
export const RadioButton: ({ checked, label, name, onChange, value, disabled, size, }: Props) => React.JSX.Element;
|
|
533
|
+
declare module '@layerfi/components/components/SkeletonBalanceSheetRow/SkeletonBalanceSheetRow' {
|
|
534
|
+
import React, { PropsWithChildren } from 'react';
|
|
535
|
+
type Props = PropsWithChildren;
|
|
536
|
+
export const SkeletonBalanceSheetRow: ({ children }: Props) => React.JSX.Element;
|
|
263
537
|
export {};
|
|
264
538
|
|
|
265
539
|
}
|
|
266
|
-
declare module '@layerfi/components/components/
|
|
267
|
-
|
|
268
|
-
|
|
540
|
+
declare module '@layerfi/components/components/SkeletonBalanceSheetRow/index' {
|
|
541
|
+
export { SkeletonBalanceSheetRow } from '@layerfi/components/components/SkeletonBalanceSheetRow/SkeletonBalanceSheetRow';
|
|
542
|
+
|
|
543
|
+
}
|
|
544
|
+
declare module '@layerfi/components/components/Textarea/Textarea' {
|
|
545
|
+
import React, { HTMLProps } from 'react';
|
|
546
|
+
export const Textarea: ({ className, ...props }: HTMLProps<HTMLTextAreaElement>) => React.JSX.Element;
|
|
547
|
+
|
|
548
|
+
}
|
|
549
|
+
declare module '@layerfi/components/components/Textarea/index' {
|
|
550
|
+
export { Textarea } from '@layerfi/components/components/Textarea/Textarea';
|
|
551
|
+
|
|
552
|
+
}
|
|
553
|
+
declare module '@layerfi/components/components/Toggle/Toggle' {
|
|
554
|
+
import React, { ChangeEvent, ReactNode } from 'react';
|
|
555
|
+
export interface Option {
|
|
269
556
|
label: string;
|
|
270
557
|
value: string;
|
|
271
558
|
disabled?: boolean;
|
|
272
|
-
|
|
273
|
-
|
|
559
|
+
leftIcon?: ReactNode;
|
|
560
|
+
}
|
|
561
|
+
export enum ToggleSize {
|
|
562
|
+
medium = "medium",
|
|
563
|
+
small = "small"
|
|
564
|
+
}
|
|
565
|
+
export interface ToggleProps {
|
|
274
566
|
name: string;
|
|
275
|
-
size?:
|
|
276
|
-
|
|
277
|
-
selected?:
|
|
278
|
-
onChange: (event:
|
|
567
|
+
size?: ToggleSize;
|
|
568
|
+
options: Option[];
|
|
569
|
+
selected?: Option['value'];
|
|
570
|
+
onChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
571
|
+
}
|
|
572
|
+
export const Toggle: ({ name, options, selected, onChange, size, }: ToggleProps) => React.JSX.Element;
|
|
573
|
+
|
|
574
|
+
}
|
|
575
|
+
declare module '@layerfi/components/components/Toggle/index' {
|
|
576
|
+
export { Toggle } from '@layerfi/components/components/Toggle/Toggle';
|
|
577
|
+
|
|
578
|
+
}
|
|
579
|
+
declare module '@layerfi/components/components/Tooltip/Tooltip' {
|
|
580
|
+
import React, { ReactNode } from 'react';
|
|
581
|
+
import type { Placement } from '@floating-ui/react';
|
|
582
|
+
export interface TooltipOptions {
|
|
583
|
+
initialOpen?: boolean;
|
|
584
|
+
placement?: Placement;
|
|
585
|
+
open?: boolean;
|
|
586
|
+
disabled?: boolean;
|
|
587
|
+
onOpenChange?: (open: boolean) => void;
|
|
588
|
+
offset?: number;
|
|
589
|
+
shift?: {
|
|
590
|
+
padding?: number;
|
|
591
|
+
};
|
|
592
|
+
}
|
|
593
|
+
export const Tooltip: ({ children, ...options }: {
|
|
594
|
+
children: ReactNode;
|
|
595
|
+
} & TooltipOptions) => React.JSX.Element;
|
|
596
|
+
export const TooltipTrigger: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLElement> & {
|
|
597
|
+
asChild?: boolean | undefined;
|
|
598
|
+
}, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
599
|
+
export const TooltipContent: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
600
|
+
|
|
601
|
+
}
|
|
602
|
+
declare module '@layerfi/components/components/Tooltip/index' {
|
|
603
|
+
export { Tooltip, TooltipTrigger, TooltipContent } from '@layerfi/components/components/Tooltip/Tooltip';
|
|
604
|
+
export { useTooltip } from '@layerfi/components/components/Tooltip/useTooltip';
|
|
605
|
+
|
|
606
|
+
}
|
|
607
|
+
declare module '@layerfi/components/components/Tooltip/useTooltip' {
|
|
608
|
+
import React from 'react';
|
|
609
|
+
import { TooltipOptions } from '@layerfi/components/components/Tooltip/Tooltip';
|
|
610
|
+
export type ContextType = ReturnType<typeof useTooltip> | null;
|
|
611
|
+
export const TooltipContext: React.Context<ContextType>;
|
|
612
|
+
export const useTooltipContext: () => {
|
|
613
|
+
placement: import("@floating-ui/utils").Placement;
|
|
614
|
+
strategy: import("@floating-ui/utils").Strategy;
|
|
615
|
+
middlewareData: import("@floating-ui/core").MiddlewareData;
|
|
616
|
+
x: number;
|
|
617
|
+
y: number;
|
|
618
|
+
isPositioned: boolean;
|
|
619
|
+
update: () => void;
|
|
620
|
+
floatingStyles: React.CSSProperties;
|
|
621
|
+
refs: {
|
|
622
|
+
reference: React.MutableRefObject<import("@floating-ui/react-dom").ReferenceType | null>;
|
|
623
|
+
floating: React.MutableRefObject<HTMLElement | null>;
|
|
624
|
+
setReference: (node: import("@floating-ui/react-dom").ReferenceType | null) => void;
|
|
625
|
+
setFloating: (node: HTMLElement | null) => void;
|
|
626
|
+
} & import("@floating-ui/react").ExtendedRefs<import("@floating-ui/react").ReferenceType>;
|
|
627
|
+
elements: {
|
|
628
|
+
reference: import("@floating-ui/react-dom").ReferenceType | null;
|
|
629
|
+
floating: HTMLElement | null;
|
|
630
|
+
} & import("@floating-ui/react").ExtendedElements<import("@floating-ui/react").ReferenceType>;
|
|
631
|
+
context: {
|
|
632
|
+
x: number;
|
|
633
|
+
y: number;
|
|
634
|
+
placement: import("@floating-ui/utils").Placement;
|
|
635
|
+
strategy: import("@floating-ui/utils").Strategy;
|
|
636
|
+
middlewareData: import("@floating-ui/core").MiddlewareData;
|
|
637
|
+
isPositioned: boolean;
|
|
638
|
+
update: () => void;
|
|
639
|
+
floatingStyles: React.CSSProperties;
|
|
640
|
+
open: boolean;
|
|
641
|
+
onOpenChange: (open: boolean, event?: Event | undefined, reason?: import("@floating-ui/react").OpenChangeReason | undefined) => void;
|
|
642
|
+
events: import("@floating-ui/react").FloatingEvents;
|
|
643
|
+
dataRef: React.MutableRefObject<import("@floating-ui/react").ContextData>;
|
|
644
|
+
nodeId: string | undefined;
|
|
645
|
+
floatingId: string;
|
|
646
|
+
refs: import("@floating-ui/react").ExtendedRefs<import("@floating-ui/react").ReferenceType>;
|
|
647
|
+
elements: import("@floating-ui/react").ExtendedElements<import("@floating-ui/react").ReferenceType>;
|
|
648
|
+
};
|
|
649
|
+
getReferenceProps: (userProps?: React.HTMLProps<Element> | undefined) => Record<string, unknown>;
|
|
650
|
+
getFloatingProps: (userProps?: React.HTMLProps<HTMLElement> | undefined) => Record<string, unknown>;
|
|
651
|
+
getItemProps: (userProps?: (Omit<React.HTMLProps<HTMLElement>, "active" | "selected"> & {
|
|
652
|
+
active?: boolean | undefined;
|
|
653
|
+
selected?: boolean | undefined;
|
|
654
|
+
}) | undefined) => Record<string, unknown>;
|
|
655
|
+
open: boolean;
|
|
656
|
+
setOpen: (open: boolean) => void;
|
|
657
|
+
isMounted: boolean;
|
|
658
|
+
styles: React.CSSProperties;
|
|
659
|
+
disabled: boolean | undefined;
|
|
279
660
|
};
|
|
280
|
-
export const
|
|
281
|
-
|
|
661
|
+
export const useTooltip: ({ initialOpen, placement, open: controlledOpen, onOpenChange: setControlledOpen, disabled, offset: offsetProp, shift: shiftProp, }?: TooltipOptions) => {
|
|
662
|
+
placement: import("@floating-ui/utils").Placement;
|
|
663
|
+
strategy: import("@floating-ui/utils").Strategy;
|
|
664
|
+
middlewareData: import("@floating-ui/core").MiddlewareData;
|
|
665
|
+
x: number;
|
|
666
|
+
y: number;
|
|
667
|
+
isPositioned: boolean;
|
|
668
|
+
update: () => void;
|
|
669
|
+
floatingStyles: React.CSSProperties;
|
|
670
|
+
refs: {
|
|
671
|
+
reference: React.MutableRefObject<import("@floating-ui/react-dom").ReferenceType | null>;
|
|
672
|
+
floating: React.MutableRefObject<HTMLElement | null>;
|
|
673
|
+
setReference: (node: import("@floating-ui/react-dom").ReferenceType | null) => void;
|
|
674
|
+
setFloating: (node: HTMLElement | null) => void;
|
|
675
|
+
} & import("@floating-ui/react").ExtendedRefs<import("@floating-ui/react").ReferenceType>;
|
|
676
|
+
elements: {
|
|
677
|
+
reference: import("@floating-ui/react-dom").ReferenceType | null;
|
|
678
|
+
floating: HTMLElement | null;
|
|
679
|
+
} & import("@floating-ui/react").ExtendedElements<import("@floating-ui/react").ReferenceType>;
|
|
680
|
+
context: {
|
|
681
|
+
x: number;
|
|
682
|
+
y: number;
|
|
683
|
+
placement: import("@floating-ui/utils").Placement;
|
|
684
|
+
strategy: import("@floating-ui/utils").Strategy;
|
|
685
|
+
middlewareData: import("@floating-ui/core").MiddlewareData;
|
|
686
|
+
isPositioned: boolean;
|
|
687
|
+
update: () => void;
|
|
688
|
+
floatingStyles: React.CSSProperties;
|
|
689
|
+
open: boolean;
|
|
690
|
+
onOpenChange: (open: boolean, event?: Event | undefined, reason?: import("@floating-ui/react").OpenChangeReason | undefined) => void;
|
|
691
|
+
events: import("@floating-ui/react").FloatingEvents;
|
|
692
|
+
dataRef: React.MutableRefObject<import("@floating-ui/react").ContextData>;
|
|
693
|
+
nodeId: string | undefined;
|
|
694
|
+
floatingId: string;
|
|
695
|
+
refs: import("@floating-ui/react").ExtendedRefs<import("@floating-ui/react").ReferenceType>;
|
|
696
|
+
elements: import("@floating-ui/react").ExtendedElements<import("@floating-ui/react").ReferenceType>;
|
|
697
|
+
};
|
|
698
|
+
getReferenceProps: (userProps?: React.HTMLProps<Element> | undefined) => Record<string, unknown>;
|
|
699
|
+
getFloatingProps: (userProps?: React.HTMLProps<HTMLElement> | undefined) => Record<string, unknown>;
|
|
700
|
+
getItemProps: (userProps?: (Omit<React.HTMLProps<HTMLElement>, "active" | "selected"> & {
|
|
701
|
+
active?: boolean | undefined;
|
|
702
|
+
selected?: boolean | undefined;
|
|
703
|
+
}) | undefined) => Record<string, unknown>;
|
|
704
|
+
open: boolean;
|
|
705
|
+
setOpen: (open: boolean) => void;
|
|
706
|
+
isMounted: boolean;
|
|
707
|
+
styles: React.CSSProperties;
|
|
708
|
+
disabled: boolean | undefined;
|
|
709
|
+
};
|
|
710
|
+
|
|
711
|
+
}
|
|
712
|
+
declare module '@layerfi/components/components/Typography/Heading' {
|
|
713
|
+
import React, { ReactNode } from 'react';
|
|
714
|
+
export enum HeadingSize {
|
|
715
|
+
primary = "primary",
|
|
716
|
+
secondary = "secondary"
|
|
717
|
+
}
|
|
718
|
+
export interface HeadingProps {
|
|
719
|
+
as?: React.ElementType;
|
|
720
|
+
className?: string;
|
|
721
|
+
children: ReactNode;
|
|
722
|
+
size?: HeadingSize;
|
|
723
|
+
}
|
|
724
|
+
export const Heading: ({ as: Component, className, children, size, }: HeadingProps) => React.JSX.Element;
|
|
282
725
|
|
|
283
726
|
}
|
|
284
|
-
declare module '@layerfi/components/components/
|
|
285
|
-
|
|
727
|
+
declare module '@layerfi/components/components/Typography/Text' {
|
|
728
|
+
import React, { ReactNode } from 'react';
|
|
729
|
+
export enum TextSize {
|
|
730
|
+
md = "md",
|
|
731
|
+
sm = "sm"
|
|
732
|
+
}
|
|
733
|
+
export enum TextWeight {
|
|
734
|
+
normal = "normal",
|
|
735
|
+
bold = "bold"
|
|
736
|
+
}
|
|
737
|
+
export enum TextUseTooltip {
|
|
738
|
+
whenTruncated = "whenTruncated",
|
|
739
|
+
always = "always"
|
|
740
|
+
}
|
|
741
|
+
export interface TextTooltipOptions {
|
|
742
|
+
contentClassName?: string;
|
|
743
|
+
offset?: number;
|
|
744
|
+
shift?: {
|
|
745
|
+
padding?: number;
|
|
746
|
+
};
|
|
747
|
+
}
|
|
748
|
+
export interface TextProps {
|
|
749
|
+
as?: React.ElementType;
|
|
750
|
+
className?: string;
|
|
751
|
+
children: ReactNode;
|
|
752
|
+
size?: TextSize;
|
|
753
|
+
weight?: TextWeight;
|
|
754
|
+
htmlFor?: string;
|
|
755
|
+
withTooltip?: TextUseTooltip;
|
|
756
|
+
tooltipOptions?: TextTooltipOptions;
|
|
757
|
+
}
|
|
758
|
+
export const Text: ({ as: Component, className, children, size, weight, withTooltip, ...props }: TextProps) => React.JSX.Element;
|
|
759
|
+
export const TextWithTooltip: ({ as: Component, className, children, size, weight, withTooltip, tooltipOptions, ...props }: TextProps) => React.JSX.Element;
|
|
760
|
+
|
|
761
|
+
}
|
|
762
|
+
declare module '@layerfi/components/components/Typography/index' {
|
|
763
|
+
export { Text, TextSize, TextWeight } from '@layerfi/components/components/Typography/Text';
|
|
764
|
+
export { Heading, HeadingSize } from '@layerfi/components/components/Typography/Heading';
|
|
286
765
|
|
|
287
766
|
}
|
|
288
767
|
declare module '@layerfi/components/contexts/LayerContext/LayerContext' {
|
|
289
768
|
/// <reference types="react" />
|
|
290
769
|
import { LayerContextValues } from '@layerfi/components/types';
|
|
291
|
-
|
|
770
|
+
import { LayerThemeConfig } from '@layerfi/components/types/layer_context';
|
|
771
|
+
export const LayerContext: import("react").Context<LayerContextValues & {
|
|
772
|
+
setTheme: (theme: LayerThemeConfig) => void;
|
|
773
|
+
}>;
|
|
292
774
|
|
|
293
775
|
}
|
|
294
776
|
declare module '@layerfi/components/contexts/LayerContext/index' {
|
|
295
777
|
export { LayerContext } from '@layerfi/components/contexts/LayerContext/LayerContext';
|
|
296
778
|
|
|
779
|
+
}
|
|
780
|
+
declare module '@layerfi/components/hooks/useBalanceSheet/index' {
|
|
781
|
+
export { useBalanceSheet } from '@layerfi/components/hooks/useBalanceSheet/useBalanceSheet';
|
|
782
|
+
|
|
783
|
+
}
|
|
784
|
+
declare module '@layerfi/components/hooks/useBalanceSheet/useBalanceSheet' {
|
|
785
|
+
import { BalanceSheet } from '@layerfi/components/types';
|
|
786
|
+
type UseBalanceSheet = (date?: Date) => {
|
|
787
|
+
data: BalanceSheet | undefined;
|
|
788
|
+
isLoading: boolean;
|
|
789
|
+
error: unknown;
|
|
790
|
+
};
|
|
791
|
+
export const useBalanceSheet: UseBalanceSheet;
|
|
792
|
+
export {};
|
|
793
|
+
|
|
297
794
|
}
|
|
298
795
|
declare module '@layerfi/components/hooks/useBankTransactions/index' {
|
|
299
796
|
export { useBankTransactions } from '@layerfi/components/hooks/useBankTransactions/useBankTransactions';
|
|
@@ -301,23 +798,54 @@ declare module '@layerfi/components/hooks/useBankTransactions/index' {
|
|
|
301
798
|
}
|
|
302
799
|
declare module '@layerfi/components/hooks/useBankTransactions/useBankTransactions' {
|
|
303
800
|
import { BankTransaction, CategoryUpdate, Metadata } from '@layerfi/components/types';
|
|
304
|
-
type
|
|
801
|
+
type UseBankTransactions = () => {
|
|
305
802
|
data: BankTransaction[];
|
|
306
803
|
metadata: Metadata;
|
|
307
804
|
isLoading: boolean;
|
|
308
805
|
error: unknown;
|
|
309
806
|
categorize: (id: BankTransaction['id'], newCategory: CategoryUpdate) => Promise<void>;
|
|
807
|
+
updateOneLocal: (bankTransaction: BankTransaction) => void;
|
|
808
|
+
};
|
|
809
|
+
export const useBankTransactions: UseBankTransactions;
|
|
810
|
+
export {};
|
|
811
|
+
|
|
812
|
+
}
|
|
813
|
+
declare module '@layerfi/components/hooks/useChartOfAccounts/index' {
|
|
814
|
+
export { useChartOfAccounts } from '@layerfi/components/hooks/useChartOfAccounts/useChartOfAccounts';
|
|
815
|
+
|
|
816
|
+
}
|
|
817
|
+
declare module '@layerfi/components/hooks/useChartOfAccounts/useChartOfAccounts' {
|
|
818
|
+
import { AccountAlternate, ChartOfAccounts, NewAccount } from '@layerfi/components/types';
|
|
819
|
+
type UseChartOfAccounts = () => {
|
|
820
|
+
data: ChartOfAccounts | undefined;
|
|
821
|
+
isLoading: boolean;
|
|
822
|
+
error: unknown;
|
|
823
|
+
create: (newAccount: NewAccount) => Promise<AccountAlternate>;
|
|
310
824
|
};
|
|
311
|
-
export const
|
|
825
|
+
export const useChartOfAccounts: UseChartOfAccounts;
|
|
312
826
|
export {};
|
|
313
827
|
|
|
828
|
+
}
|
|
829
|
+
declare module '@layerfi/components/hooks/useElementSize/index' {
|
|
830
|
+
export { useElementSize } from '@layerfi/components/hooks/useElementSize/useElementSize';
|
|
831
|
+
|
|
832
|
+
}
|
|
833
|
+
declare module '@layerfi/components/hooks/useElementSize/useElementSize' {
|
|
834
|
+
/// <reference types="react" />
|
|
835
|
+
export const useElementSize: <T extends HTMLElement>(callback: (target: T, entry: ResizeObserverEntry, size: {
|
|
836
|
+
width: number;
|
|
837
|
+
height: number;
|
|
838
|
+
}) => void) => import("react").RefObject<T>;
|
|
839
|
+
|
|
314
840
|
}
|
|
315
841
|
declare module '@layerfi/components/hooks/useLayerContext/index' {
|
|
316
842
|
export { useLayerContext } from '@layerfi/components/hooks/useLayerContext/useLayerContext';
|
|
317
843
|
|
|
318
844
|
}
|
|
319
845
|
declare module '@layerfi/components/hooks/useLayerContext/useLayerContext' {
|
|
320
|
-
export const useLayerContext: () => import("@layerfi/components/types").LayerContextValues
|
|
846
|
+
export const useLayerContext: () => import("@layerfi/components/types").LayerContextValues & {
|
|
847
|
+
setTheme: (theme: import("@layerfi/components/types/layer_context").LayerThemeConfig) => void;
|
|
848
|
+
};
|
|
321
849
|
|
|
322
850
|
}
|
|
323
851
|
declare module '@layerfi/components/hooks/useProfitAndLoss/index' {
|
|
@@ -326,38 +854,50 @@ declare module '@layerfi/components/hooks/useProfitAndLoss/index' {
|
|
|
326
854
|
}
|
|
327
855
|
declare module '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLoss' {
|
|
328
856
|
import { ProfitAndLoss, DateRange } from '@layerfi/components/types';
|
|
329
|
-
type
|
|
857
|
+
type Props = DateRange;
|
|
858
|
+
type UseProfitAndLoss = (props?: Props) => {
|
|
330
859
|
data: ProfitAndLoss | undefined;
|
|
331
860
|
isLoading: boolean;
|
|
332
861
|
error: unknown;
|
|
333
862
|
dateRange: DateRange;
|
|
334
863
|
changeDateRange: (dateRange: Partial<DateRange>) => void;
|
|
335
864
|
};
|
|
336
|
-
|
|
337
|
-
export const useProfitAndLoss: ({ startDate: initialStartDate, endDate: initialEndDate }?: Props) => UseProfitAndLoss;
|
|
865
|
+
export const useProfitAndLoss: UseProfitAndLoss;
|
|
338
866
|
export {};
|
|
339
867
|
|
|
340
868
|
}
|
|
341
|
-
declare module '@layerfi/components/
|
|
342
|
-
|
|
869
|
+
declare module '@layerfi/components/icons/AlertCircle' {
|
|
870
|
+
import * as React from 'react';
|
|
871
|
+
import { IconSvgProps } from '@layerfi/components/icons/types';
|
|
872
|
+
const AlertCircle: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
|
|
873
|
+
export default AlertCircle;
|
|
343
874
|
|
|
344
875
|
}
|
|
345
|
-
declare module '@layerfi/components/icons/
|
|
876
|
+
declare module '@layerfi/components/icons/Calendar' {
|
|
346
877
|
import * as React from 'react';
|
|
347
878
|
import { SVGProps } from 'react';
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
879
|
+
const Calendar: (props: SVGProps<SVGSVGElement>) => React.JSX.Element;
|
|
880
|
+
export default Calendar;
|
|
881
|
+
|
|
882
|
+
}
|
|
883
|
+
declare module '@layerfi/components/icons/Check' {
|
|
884
|
+
import * as React from 'react';
|
|
885
|
+
import { IconSvgProps } from '@layerfi/components/icons/types';
|
|
886
|
+
const Check: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
|
|
887
|
+
export default Check;
|
|
888
|
+
|
|
889
|
+
}
|
|
890
|
+
declare module '@layerfi/components/icons/CheckCircle' {
|
|
891
|
+
import * as React from 'react';
|
|
892
|
+
import { IconSvgProps } from '@layerfi/components/icons/types';
|
|
893
|
+
const CheckCircle: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
|
|
894
|
+
export default CheckCircle;
|
|
355
895
|
|
|
356
896
|
}
|
|
357
897
|
declare module '@layerfi/components/icons/ChevronDown' {
|
|
358
898
|
import * as React from 'react';
|
|
359
|
-
import {
|
|
360
|
-
const ChevronDown: (props:
|
|
899
|
+
import { IconSvgProps } from '@layerfi/components/icons/types';
|
|
900
|
+
const ChevronDown: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
|
|
361
901
|
export default ChevronDown;
|
|
362
902
|
|
|
363
903
|
}
|
|
@@ -375,65 +915,121 @@ declare module '@layerfi/components/icons/ChevronLeft' {
|
|
|
375
915
|
declare module '@layerfi/components/icons/ChevronRight' {
|
|
376
916
|
import * as React from 'react';
|
|
377
917
|
import { SVGProps } from 'react';
|
|
378
|
-
type Props = {
|
|
379
|
-
|
|
380
|
-
size?: number;
|
|
918
|
+
type Props = SVGProps<SVGSVGElement> & {
|
|
919
|
+
size: SVGProps<SVGSVGElement>['width'];
|
|
381
920
|
};
|
|
382
|
-
const ChavronRight: ({
|
|
921
|
+
const ChavronRight: ({ size, ...props }: Props) => React.JSX.Element;
|
|
383
922
|
export default ChavronRight;
|
|
384
923
|
|
|
385
924
|
}
|
|
386
|
-
declare module '@layerfi/components/icons/
|
|
925
|
+
declare module '@layerfi/components/icons/DownloadCloud' {
|
|
387
926
|
import * as React from 'react';
|
|
388
927
|
import { SVGProps } from 'react';
|
|
389
|
-
const
|
|
390
|
-
export default
|
|
928
|
+
const DownloadCloud: (props: SVGProps<SVGSVGElement>) => React.JSX.Element;
|
|
929
|
+
export default DownloadCloud;
|
|
930
|
+
|
|
931
|
+
}
|
|
932
|
+
declare module '@layerfi/components/icons/FolderPlus' {
|
|
933
|
+
import * as React from 'react';
|
|
934
|
+
import { IconSvgProps } from '@layerfi/components/icons/types';
|
|
935
|
+
const FolderPlus: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
|
|
936
|
+
export default FolderPlus;
|
|
391
937
|
|
|
392
938
|
}
|
|
393
939
|
declare module '@layerfi/components/icons/Link' {
|
|
394
940
|
import * as React from 'react';
|
|
395
|
-
import {
|
|
396
|
-
|
|
397
|
-
size: SVGProps<SVGSVGElement>['width'];
|
|
398
|
-
};
|
|
399
|
-
const Link: ({ size, ...props }: Props) => React.JSX.Element;
|
|
941
|
+
import { IconSvgProps } from '@layerfi/components/icons/types';
|
|
942
|
+
const Link: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
|
|
400
943
|
export default Link;
|
|
401
944
|
|
|
402
945
|
}
|
|
403
|
-
declare module '@layerfi/components/icons/
|
|
946
|
+
declare module '@layerfi/components/icons/Loader' {
|
|
947
|
+
import * as React from 'react';
|
|
948
|
+
import { IconSvgProps } from '@layerfi/components/icons/types';
|
|
949
|
+
const Loader: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
|
|
950
|
+
export default Loader;
|
|
951
|
+
|
|
952
|
+
}
|
|
953
|
+
declare module '@layerfi/components/icons/RefreshCcw' {
|
|
954
|
+
import * as React from 'react';
|
|
955
|
+
import { IconSvgProps } from '@layerfi/components/icons/types';
|
|
956
|
+
const RefreshCcw: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
|
|
957
|
+
export default RefreshCcw;
|
|
958
|
+
|
|
959
|
+
}
|
|
960
|
+
declare module '@layerfi/components/icons/ScissorsFullOpen' {
|
|
961
|
+
import * as React from 'react';
|
|
962
|
+
import { IconSvgProps } from '@layerfi/components/icons/types';
|
|
963
|
+
const ScissorsFullOpen: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
|
|
964
|
+
export default ScissorsFullOpen;
|
|
965
|
+
|
|
966
|
+
}
|
|
967
|
+
declare module '@layerfi/components/icons/UploadCloud' {
|
|
404
968
|
import * as React from 'react';
|
|
969
|
+
import { IconSvgProps } from '@layerfi/components/icons/types';
|
|
970
|
+
const UploadCloud: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
|
|
971
|
+
export default UploadCloud;
|
|
972
|
+
|
|
973
|
+
}
|
|
974
|
+
declare module '@layerfi/components/icons/types' {
|
|
405
975
|
import { SVGProps } from 'react';
|
|
406
|
-
type
|
|
407
|
-
size
|
|
976
|
+
export type IconSvgProps = SVGProps<SVGSVGElement> & {
|
|
977
|
+
size?: SVGProps<SVGSVGElement>['width'];
|
|
408
978
|
};
|
|
409
|
-
const LinkBroken: ({ size, ...props }: Props) => React.JSX.Element;
|
|
410
|
-
export default LinkBroken;
|
|
411
979
|
|
|
412
980
|
}
|
|
413
981
|
declare module '@layerfi/components/index' {
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
export {
|
|
982
|
+
export { BalanceSheet } from '@layerfi/components/components/BalanceSheet/index';
|
|
983
|
+
export { BankTransactions } from '@layerfi/components/components/BankTransactions/index';
|
|
984
|
+
export { Hello } from '@layerfi/components/components/Hello/index';
|
|
985
|
+
export { ProfitAndLoss } from '@layerfi/components/components/ProfitAndLoss/index';
|
|
986
|
+
export { LayerProvider } from '@layerfi/components/providers/LayerProvider/index';
|
|
987
|
+
export { ChartOfAccounts } from '@layerfi/components/components/ChartOfAccounts/index';
|
|
988
|
+
|
|
989
|
+
}
|
|
990
|
+
declare module '@layerfi/components/models/APIError' {
|
|
991
|
+
export interface APIErrorMessage {
|
|
992
|
+
type?: string;
|
|
993
|
+
description?: string;
|
|
994
|
+
}
|
|
995
|
+
export class APIError extends Error {
|
|
996
|
+
code?: number;
|
|
997
|
+
info?: string;
|
|
998
|
+
messages?: APIErrorMessage[];
|
|
999
|
+
constructor(message: string, code?: number, messages?: APIErrorMessage[]);
|
|
1000
|
+
getMessage(): string;
|
|
1001
|
+
getAllMessages(): (string | undefined)[] | undefined;
|
|
1002
|
+
}
|
|
419
1003
|
|
|
420
1004
|
}
|
|
421
1005
|
declare module '@layerfi/components/models/Money' {
|
|
422
|
-
export const centsToDollars: (cents
|
|
423
|
-
export const dollarsToCents: (dollars
|
|
1006
|
+
export const centsToDollars: (cents?: number) => string;
|
|
1007
|
+
export const dollarsToCents: (dollars?: string) => number;
|
|
424
1008
|
const _default: {
|
|
425
|
-
centsToDollars: (cents
|
|
426
|
-
dollarsToCents: (dollars
|
|
1009
|
+
centsToDollars: (cents?: number) => string;
|
|
1010
|
+
dollarsToCents: (dollars?: string) => number;
|
|
427
1011
|
};
|
|
428
1012
|
export default _default;
|
|
429
1013
|
|
|
430
1014
|
}
|
|
431
1015
|
declare module '@layerfi/components/providers/LayerProvider/LayerProvider' {
|
|
432
1016
|
import React, { PropsWithChildren } from 'react';
|
|
433
|
-
|
|
1017
|
+
import { LayerThemeConfig } from '@layerfi/components/types/layer_context';
|
|
1018
|
+
type LayerEnvironmentConfig = {
|
|
1019
|
+
url: string;
|
|
1020
|
+
scope: string;
|
|
1021
|
+
apiUrl: string;
|
|
1022
|
+
};
|
|
1023
|
+
export const LayerEnvironment: Record<string, LayerEnvironmentConfig>;
|
|
1024
|
+
export type Props = {
|
|
434
1025
|
businessId: string;
|
|
1026
|
+
appId?: string;
|
|
1027
|
+
appSecret?: string;
|
|
1028
|
+
businessAccessToken?: string;
|
|
1029
|
+
environment?: keyof typeof LayerEnvironment;
|
|
1030
|
+
theme?: LayerThemeConfig;
|
|
435
1031
|
};
|
|
436
|
-
export const LayerProvider: ({ businessId, children, }: PropsWithChildren<Props>) => React.JSX.Element;
|
|
1032
|
+
export const LayerProvider: ({ appId, appSecret, businessId, children, businessAccessToken, environment, theme, }: PropsWithChildren<Props>) => React.JSX.Element;
|
|
437
1033
|
export {};
|
|
438
1034
|
|
|
439
1035
|
}
|
|
@@ -459,63 +1055,55 @@ declare module '@layerfi/components/types/authentication' {
|
|
|
459
1055
|
token_type: string;
|
|
460
1056
|
expires_in: number;
|
|
461
1057
|
};
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
declare module '@layerfi/components/types/layer_context' {
|
|
465
|
-
import { Category } from '@layerfi/components/types';
|
|
466
|
-
import { OAuthResponse } from '@layerfi/components/types/authentication';
|
|
467
|
-
export type LayerContextValues = {
|
|
468
|
-
auth: OAuthResponse;
|
|
469
|
-
businessId: string;
|
|
470
|
-
categories: Category[];
|
|
471
|
-
};
|
|
472
|
-
export enum LayerContextActionName {
|
|
473
|
-
setAuth = "LayerContext.setAuth",
|
|
474
|
-
setCategories = "LayerContext.setCategories"
|
|
475
|
-
}
|
|
476
|
-
export type LayerContextAction = {
|
|
477
|
-
type: LayerContextActionName.setAuth;
|
|
478
|
-
payload: {
|
|
479
|
-
auth: LayerContextValues['auth'];
|
|
480
|
-
};
|
|
481
|
-
} | {
|
|
482
|
-
type: LayerContextActionName.setCategories;
|
|
483
|
-
payload: {
|
|
484
|
-
categories: LayerContextValues['categories'];
|
|
485
|
-
};
|
|
1058
|
+
export type ExpiringOAuthResponse = OAuthResponse & {
|
|
1059
|
+
expires_at: Date;
|
|
486
1060
|
};
|
|
487
1061
|
|
|
488
1062
|
}
|
|
489
|
-
declare module '@layerfi/components/types/
|
|
490
|
-
|
|
491
|
-
|
|
1063
|
+
declare module '@layerfi/components/types/balance_sheet' {
|
|
1064
|
+
import { LineItem } from '@layerfi/components/types/line_item';
|
|
1065
|
+
export interface BalanceSheet {
|
|
492
1066
|
business_id: string;
|
|
1067
|
+
type: 'Balance_Sheet';
|
|
493
1068
|
start_date: string;
|
|
494
1069
|
end_date: string;
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
gross_profit: number;
|
|
498
|
-
expenses: LineItem;
|
|
499
|
-
profit_before_taxes: number;
|
|
500
|
-
taxes: LineItem;
|
|
501
|
-
net_profit: number;
|
|
502
|
-
other_outflows?: LineItem | null;
|
|
503
|
-
personal_expenses?: LineItem | null;
|
|
1070
|
+
assets: LineItem[];
|
|
1071
|
+
liabilities_and_equity: LineItem[];
|
|
504
1072
|
fully_categorized: boolean;
|
|
505
1073
|
}
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
1074
|
+
|
|
1075
|
+
}
|
|
1076
|
+
declare module '@layerfi/components/types/bank_transactions' {
|
|
1077
|
+
import { Categorization, CategorizationStatus, Category } from '@layerfi/components/types/categories';
|
|
1078
|
+
export enum Direction {
|
|
1079
|
+
CREDIT = "CREDIT",
|
|
1080
|
+
DEBIT = "DEBIT"
|
|
1081
|
+
}
|
|
1082
|
+
export interface BankTransaction extends Record<string, unknown> {
|
|
1083
|
+
type: 'Bank_Transaction';
|
|
1084
|
+
account_name?: string;
|
|
1085
|
+
business_id: string;
|
|
1086
|
+
recently_categorized?: boolean;
|
|
1087
|
+
id: string;
|
|
1088
|
+
date: string;
|
|
1089
|
+
source: string;
|
|
1090
|
+
source_transaction_id: string;
|
|
1091
|
+
source_account_id: string;
|
|
1092
|
+
imported_at: string;
|
|
1093
|
+
description: string | null;
|
|
1094
|
+
amount: number;
|
|
1095
|
+
direction: Direction;
|
|
1096
|
+
counterparty_name: string;
|
|
1097
|
+
category: Category;
|
|
1098
|
+
categorization_status: CategorizationStatus;
|
|
1099
|
+
categorization_flow: Categorization;
|
|
1100
|
+
categorization_method: string;
|
|
1101
|
+
error?: string;
|
|
1102
|
+
processing?: boolean;
|
|
511
1103
|
}
|
|
512
1104
|
|
|
513
1105
|
}
|
|
514
|
-
declare module '@layerfi/components/types' {
|
|
515
|
-
export { OAuthResponse } from '@layerfi/components/types/authentication';
|
|
516
|
-
export { LayerContextValues, LayerContextActionName, LayerContextAction, } from '@layerfi/components/types/layer_context';
|
|
517
|
-
export { Metadata } from '@layerfi/components/types/api';
|
|
518
|
-
export { ProfitAndLoss, LineItem } from '@layerfi/components/types/profit_and_loss';
|
|
1106
|
+
declare module '@layerfi/components/types/categories' {
|
|
519
1107
|
export enum CategorizationStatus {
|
|
520
1108
|
PENDING = "PENDING",
|
|
521
1109
|
READY_FOR_INPUT = "READY_FOR_INPUT",
|
|
@@ -524,10 +1112,6 @@ declare module '@layerfi/components/types' {
|
|
|
524
1112
|
SPLIT = "SPLIT",
|
|
525
1113
|
JOURNALING = "JOURNALING"
|
|
526
1114
|
}
|
|
527
|
-
export enum Direction {
|
|
528
|
-
CREDIT = "CREDIT",
|
|
529
|
-
DEBIT = "DEBIT"
|
|
530
|
-
}
|
|
531
1115
|
export interface Category {
|
|
532
1116
|
id: string;
|
|
533
1117
|
type: string;
|
|
@@ -550,24 +1134,7 @@ declare module '@layerfi/components/types' {
|
|
|
550
1134
|
type: CategorizationType;
|
|
551
1135
|
suggestions: Category[];
|
|
552
1136
|
}
|
|
553
|
-
export
|
|
554
|
-
type: 'Bank_Transaction';
|
|
555
|
-
business_id: string;
|
|
556
|
-
id: string;
|
|
557
|
-
date: string;
|
|
558
|
-
source: string;
|
|
559
|
-
source_transaction_id: string;
|
|
560
|
-
source_account_id: string;
|
|
561
|
-
imported_at: string;
|
|
562
|
-
description: string | null;
|
|
563
|
-
amount: number;
|
|
564
|
-
direction: Direction;
|
|
565
|
-
counterparty_name: string;
|
|
566
|
-
category: Category;
|
|
567
|
-
categorization_status: CategorizationStatus;
|
|
568
|
-
categorization_flow: AutoCategorization | SuggestedCategorization;
|
|
569
|
-
categorization_method: string;
|
|
570
|
-
}
|
|
1137
|
+
export type Categorization = AutoCategorization | SuggestedCategorization;
|
|
571
1138
|
export type SingleCategoryUpdate = {
|
|
572
1139
|
type: 'Category';
|
|
573
1140
|
category: {
|
|
@@ -583,13 +1150,160 @@ declare module '@layerfi/components/types' {
|
|
|
583
1150
|
}[];
|
|
584
1151
|
};
|
|
585
1152
|
export type CategoryUpdate = SingleCategoryUpdate | SplitCategoryUpdate;
|
|
1153
|
+
|
|
1154
|
+
}
|
|
1155
|
+
declare module '@layerfi/components/types/chart_of_accounts' {
|
|
1156
|
+
import { Direction } from '@layerfi/components/types/bank_transactions';
|
|
1157
|
+
import { Category } from '@layerfi/components/types/categories';
|
|
1158
|
+
export interface ChartOfAccounts {
|
|
1159
|
+
name: string;
|
|
1160
|
+
accounts: Account[];
|
|
1161
|
+
}
|
|
1162
|
+
export interface Account {
|
|
1163
|
+
id: string;
|
|
1164
|
+
number: number;
|
|
1165
|
+
pnlCategory?: Category;
|
|
1166
|
+
headerForPnlCategory?: Category;
|
|
1167
|
+
name: string;
|
|
1168
|
+
accountStableName?: string;
|
|
1169
|
+
description?: string;
|
|
1170
|
+
scheduleCLine?: string;
|
|
1171
|
+
scheduleCLineDescription?: string;
|
|
1172
|
+
subAccounts?: Account[];
|
|
1173
|
+
hidePnl: boolean;
|
|
1174
|
+
showInPnlIfEmpty: boolean;
|
|
1175
|
+
normality: Direction;
|
|
1176
|
+
balance: number;
|
|
1177
|
+
selfOnlyBalance: number;
|
|
1178
|
+
}
|
|
1179
|
+
export interface AccountAlternate {
|
|
1180
|
+
type: 'Ledger_Account';
|
|
1181
|
+
id: string;
|
|
1182
|
+
name: string;
|
|
1183
|
+
stable_name: string | null;
|
|
1184
|
+
normality: Direction;
|
|
1185
|
+
pnl_category: string | null;
|
|
1186
|
+
}
|
|
1187
|
+
export type NewAccount = {
|
|
1188
|
+
name: string;
|
|
1189
|
+
normality: Direction;
|
|
1190
|
+
parent_id: {
|
|
1191
|
+
type: 'AccountId';
|
|
1192
|
+
id: string;
|
|
1193
|
+
};
|
|
1194
|
+
description: string;
|
|
1195
|
+
};
|
|
1196
|
+
|
|
1197
|
+
}
|
|
1198
|
+
declare module '@layerfi/components/types/layer_context' {
|
|
1199
|
+
import { Category } from '@layerfi/components/types';
|
|
1200
|
+
import { ExpiringOAuthResponse } from '@layerfi/components/types/authentication';
|
|
1201
|
+
export type LayerContextValues = {
|
|
1202
|
+
auth: ExpiringOAuthResponse;
|
|
1203
|
+
businessId: string;
|
|
1204
|
+
categories: Category[];
|
|
1205
|
+
apiUrl: string;
|
|
1206
|
+
theme?: LayerThemeConfig;
|
|
1207
|
+
};
|
|
1208
|
+
export interface ColorHSLConfig {
|
|
1209
|
+
h: string;
|
|
1210
|
+
s: string;
|
|
1211
|
+
l: string;
|
|
1212
|
+
}
|
|
1213
|
+
export interface ColorRGBConfig {
|
|
1214
|
+
r: string;
|
|
1215
|
+
g: string;
|
|
1216
|
+
b: string;
|
|
1217
|
+
}
|
|
1218
|
+
export interface ColorHexConfig {
|
|
1219
|
+
hex: string;
|
|
1220
|
+
}
|
|
1221
|
+
export type ColorConfig = ColorHSLConfig | ColorRGBConfig | ColorHexConfig;
|
|
1222
|
+
export interface LayerThemeConfig {
|
|
1223
|
+
colors?: {
|
|
1224
|
+
dark?: ColorConfig;
|
|
1225
|
+
light?: ColorConfig;
|
|
1226
|
+
};
|
|
1227
|
+
}
|
|
1228
|
+
export enum LayerContextActionName {
|
|
1229
|
+
setAuth = "LayerContext.setAuth",
|
|
1230
|
+
setCategories = "LayerContext.setCategories",
|
|
1231
|
+
setTheme = "LayerContext.setTheme"
|
|
1232
|
+
}
|
|
1233
|
+
export type LayerContextAction = {
|
|
1234
|
+
type: LayerContextActionName.setAuth;
|
|
1235
|
+
payload: {
|
|
1236
|
+
auth: LayerContextValues['auth'];
|
|
1237
|
+
};
|
|
1238
|
+
} | {
|
|
1239
|
+
type: LayerContextActionName.setCategories;
|
|
1240
|
+
payload: {
|
|
1241
|
+
categories: LayerContextValues['categories'];
|
|
1242
|
+
};
|
|
1243
|
+
} | {
|
|
1244
|
+
type: LayerContextActionName.setTheme;
|
|
1245
|
+
payload: {
|
|
1246
|
+
theme: LayerContextValues['theme'];
|
|
1247
|
+
};
|
|
1248
|
+
};
|
|
1249
|
+
|
|
1250
|
+
}
|
|
1251
|
+
declare module '@layerfi/components/types/line_item' {
|
|
1252
|
+
export interface LineItem {
|
|
1253
|
+
name?: string;
|
|
1254
|
+
display_name: string;
|
|
1255
|
+
value: number | undefined;
|
|
1256
|
+
line_items?: LineItem[] | null;
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
}
|
|
1260
|
+
declare module '@layerfi/components/types/profit_and_loss' {
|
|
1261
|
+
import { LineItem } from '@layerfi/components/types/line_item';
|
|
1262
|
+
export interface ProfitAndLoss {
|
|
1263
|
+
type: 'Profit_And_Loss';
|
|
1264
|
+
business_id: string;
|
|
1265
|
+
start_date: string;
|
|
1266
|
+
end_date: string;
|
|
1267
|
+
income: LineItem;
|
|
1268
|
+
cost_of_goods_sold?: LineItem | null;
|
|
1269
|
+
gross_profit: number;
|
|
1270
|
+
expenses: LineItem;
|
|
1271
|
+
profit_before_taxes: number;
|
|
1272
|
+
taxes: LineItem;
|
|
1273
|
+
net_profit: number;
|
|
1274
|
+
other_outflows?: LineItem | null;
|
|
1275
|
+
personal_expenses?: LineItem | null;
|
|
1276
|
+
fully_categorized: boolean;
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
}
|
|
1280
|
+
declare module '@layerfi/components/types' {
|
|
1281
|
+
export { OAuthResponse } from '@layerfi/components/types/authentication';
|
|
1282
|
+
export { LayerContextValues, LayerContextActionName, LayerContextAction, } from '@layerfi/components/types/layer_context';
|
|
1283
|
+
export { Metadata } from '@layerfi/components/types/api';
|
|
1284
|
+
export { ProfitAndLoss } from '@layerfi/components/types/profit_and_loss';
|
|
1285
|
+
export { LineItem } from '@layerfi/components/types/line_item';
|
|
1286
|
+
export { BalanceSheet } from '@layerfi/components/types/balance_sheet';
|
|
1287
|
+
export { Direction, BankTransaction } from '@layerfi/components/types/bank_transactions';
|
|
1288
|
+
export { CategorizationStatus, Category, CategorizationType, AutoCategorization, SuggestedCategorization, SingleCategoryUpdate, SplitCategoryUpdate, CategoryUpdate, } from '@layerfi/components/types/categories';
|
|
1289
|
+
export { AccountAlternate, ChartOfAccounts, Account, NewAccount, } from '@layerfi/components/types/chart_of_accounts';
|
|
586
1290
|
export type DateRange<T = Date> = {
|
|
587
1291
|
startDate: T;
|
|
588
1292
|
endDate: T;
|
|
589
1293
|
};
|
|
590
1294
|
|
|
1295
|
+
}
|
|
1296
|
+
declare module '@layerfi/components/utils/colors' {
|
|
1297
|
+
import { LayerThemeConfig } from '@layerfi/components/types/layer_context';
|
|
1298
|
+
/**
|
|
1299
|
+
* Convert `theme` config set in Provider into component styles.
|
|
1300
|
+
*
|
|
1301
|
+
* @param {LayerThemeConfig} theme - the theme set with provider
|
|
1302
|
+
*/
|
|
1303
|
+
export const parseStylesFromThemeConfig: (theme?: LayerThemeConfig) => {};
|
|
1304
|
+
|
|
591
1305
|
}
|
|
592
1306
|
declare module '@layerfi/components' {
|
|
593
|
-
import main = require('@layerfi/components/
|
|
1307
|
+
import main = require('@layerfi/components/index');
|
|
594
1308
|
export = main;
|
|
595
1309
|
}
|