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