@layerfi/components 0.1.0
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/README.md +70 -0
- package/dist/esm/index.js +1615 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/index.d.ts +595 -0
- package/dist/index.js +1647 -0
- package/dist/index.js.map +7 -0
- package/dist/styles/index.css +596 -0
- package/dist/styles/index.css.map +7 -0
- package/package.json +90 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,595 @@
|
|
|
1
|
+
declare module '@layerfi/components/api/layer/authenticate' {
|
|
2
|
+
import { OAuthResponse } from '@layerfi/components/types';
|
|
3
|
+
export const authenticate: () => Promise<OAuthResponse>;
|
|
4
|
+
|
|
5
|
+
}
|
|
6
|
+
declare module '@layerfi/components/api/layer/authenticated_http' {
|
|
7
|
+
export const get: <Return = Record<string, string>, Params = Record<string, string>>(url: (params: Params) => string) => (accessToken: string | undefined, options?: {
|
|
8
|
+
params?: Params | undefined;
|
|
9
|
+
} | undefined) => () => Promise<Return>;
|
|
10
|
+
export const put: <Body_1 = Record<string, string>, Return = Record<string, string>, Params = Record<string, string>>(url: (params: Params) => string) => (accessToken: string | undefined, options?: {
|
|
11
|
+
params?: Params | undefined;
|
|
12
|
+
body?: Body_1 | undefined;
|
|
13
|
+
} | undefined) => Promise<Return>;
|
|
14
|
+
|
|
15
|
+
}
|
|
16
|
+
declare module '@layerfi/components/api/layer/bankTransactions' {
|
|
17
|
+
import { CategoryUpdate, BankTransaction, Metadata } from '@layerfi/components/types';
|
|
18
|
+
export const getBankTransactions: (accessToken: string | undefined, options?: {
|
|
19
|
+
params?: Record<string, string> | undefined;
|
|
20
|
+
} | undefined) => () => Promise<{
|
|
21
|
+
data?: BankTransaction[] | undefined;
|
|
22
|
+
meta?: Metadata | undefined;
|
|
23
|
+
error?: unknown;
|
|
24
|
+
}>;
|
|
25
|
+
export const categorizeBankTransaction: (accessToken: string | undefined, options?: {
|
|
26
|
+
params?: Record<string, string> | undefined;
|
|
27
|
+
body?: CategoryUpdate | undefined;
|
|
28
|
+
} | undefined) => Promise<{
|
|
29
|
+
data: BankTransaction;
|
|
30
|
+
error: unknown;
|
|
31
|
+
}>;
|
|
32
|
+
|
|
33
|
+
}
|
|
34
|
+
declare module '@layerfi/components/api/layer/categories' {
|
|
35
|
+
import { Category } from '@layerfi/components/types';
|
|
36
|
+
export const getCategories: (accessToken: string | undefined, options?: {
|
|
37
|
+
params?: Record<string, string> | undefined;
|
|
38
|
+
} | undefined) => () => Promise<{
|
|
39
|
+
data: {
|
|
40
|
+
type: 'Category_List';
|
|
41
|
+
categories: Category[];
|
|
42
|
+
};
|
|
43
|
+
}>;
|
|
44
|
+
|
|
45
|
+
}
|
|
46
|
+
declare module '@layerfi/components/api/layer/profit_and_loss' {
|
|
47
|
+
import { ProfitAndLoss } from '@layerfi/components/types';
|
|
48
|
+
export const getProfitAndLoss: (accessToken: string | undefined, options?: {
|
|
49
|
+
params?: Record<string, string> | undefined;
|
|
50
|
+
} | undefined) => () => Promise<{
|
|
51
|
+
data?: ProfitAndLoss | undefined;
|
|
52
|
+
error?: unknown;
|
|
53
|
+
}>;
|
|
54
|
+
|
|
55
|
+
}
|
|
56
|
+
declare module '@layerfi/components/api/layer' {
|
|
57
|
+
export const Layer: {
|
|
58
|
+
authenticate: () => Promise<import("@layerfi/components/types").OAuthResponse>;
|
|
59
|
+
getCategories: (accessToken: string | undefined, options?: {
|
|
60
|
+
params?: Record<string, string> | undefined;
|
|
61
|
+
} | undefined) => () => Promise<{
|
|
62
|
+
data: {
|
|
63
|
+
type: "Category_List";
|
|
64
|
+
categories: import("@layerfi/components/types").Category[];
|
|
65
|
+
};
|
|
66
|
+
}>;
|
|
67
|
+
getBankTransactions: (accessToken: string | undefined, options?: {
|
|
68
|
+
params?: Record<string, string> | undefined;
|
|
69
|
+
} | undefined) => () => Promise<{
|
|
70
|
+
data?: import("@layerfi/components/types").BankTransaction[] | undefined;
|
|
71
|
+
meta?: import("@layerfi/components/types").Metadata | undefined;
|
|
72
|
+
error?: unknown;
|
|
73
|
+
}>;
|
|
74
|
+
getProfitAndLoss: (accessToken: string | undefined, options?: {
|
|
75
|
+
params?: Record<string, string> | undefined;
|
|
76
|
+
} | undefined) => () => Promise<{
|
|
77
|
+
data?: import("@layerfi/components/types").ProfitAndLoss | undefined;
|
|
78
|
+
error?: unknown;
|
|
79
|
+
}>;
|
|
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
|
+
};
|
|
88
|
+
|
|
89
|
+
}
|
|
90
|
+
declare module '@layerfi/components/api/util' {
|
|
91
|
+
export const formStringFromObject: (object: Object) => string;
|
|
92
|
+
|
|
93
|
+
}
|
|
94
|
+
declare module '@layerfi/components/components/BankTransactionRow/BankTransactionRow' {
|
|
95
|
+
import React from 'react';
|
|
96
|
+
import { BankTransaction } from '@layerfi/components/types';
|
|
97
|
+
type Props = {
|
|
98
|
+
dateFormat: string;
|
|
99
|
+
bankTransaction: BankTransaction;
|
|
100
|
+
isOpen: boolean;
|
|
101
|
+
toggleOpen: (id: string) => void;
|
|
102
|
+
editable: boolean;
|
|
103
|
+
};
|
|
104
|
+
export const BankTransactionRow: ({ dateFormat, bankTransaction, isOpen, toggleOpen, editable, }: Props) => React.JSX.Element;
|
|
105
|
+
export {};
|
|
106
|
+
|
|
107
|
+
}
|
|
108
|
+
declare module '@layerfi/components/components/BankTransactionRow/index' {
|
|
109
|
+
export { BankTransactionRow } from '@layerfi/components/components/BankTransactionRow/BankTransactionRow';
|
|
110
|
+
|
|
111
|
+
}
|
|
112
|
+
declare module '@layerfi/components/components/BankTransactions/BankTransactions' {
|
|
113
|
+
import React from 'react';
|
|
114
|
+
export const BankTransactions: () => React.JSX.Element;
|
|
115
|
+
|
|
116
|
+
}
|
|
117
|
+
declare module '@layerfi/components/components/BankTransactions/index' {
|
|
118
|
+
export { BankTransactions } from '@layerfi/components/components/BankTransactions/BankTransactions';
|
|
119
|
+
|
|
120
|
+
}
|
|
121
|
+
declare module '@layerfi/components/components/CategoryMenu/CategoryMenu' {
|
|
122
|
+
import React from 'react';
|
|
123
|
+
import { BankTransaction, Category } from '@layerfi/components/types';
|
|
124
|
+
type Props = {
|
|
125
|
+
name?: string;
|
|
126
|
+
bankTransaction: BankTransaction;
|
|
127
|
+
value: Category | undefined;
|
|
128
|
+
onChange: (newValue: Category) => void;
|
|
129
|
+
};
|
|
130
|
+
export const CategoryMenu: ({ bankTransaction, name, value, onChange, }: Props) => React.JSX.Element;
|
|
131
|
+
export {};
|
|
132
|
+
|
|
133
|
+
}
|
|
134
|
+
declare module '@layerfi/components/components/CategoryMenu/index' {
|
|
135
|
+
export { CategoryMenu } from '@layerfi/components/components/CategoryMenu/CategoryMenu';
|
|
136
|
+
|
|
137
|
+
}
|
|
138
|
+
declare module '@layerfi/components/components/ExpandedBankTransactionRow/ExpandedBankTransactionRow' {
|
|
139
|
+
import React from 'react';
|
|
140
|
+
import { BankTransaction } from '@layerfi/components/types';
|
|
141
|
+
type Props = {
|
|
142
|
+
bankTransaction: BankTransaction;
|
|
143
|
+
close?: () => void;
|
|
144
|
+
};
|
|
145
|
+
export const ExpandedBankTransactionRow: ({ bankTransaction, close, }: Props) => React.JSX.Element;
|
|
146
|
+
export {};
|
|
147
|
+
|
|
148
|
+
}
|
|
149
|
+
declare module '@layerfi/components/components/ExpandedBankTransactionRow/index' {
|
|
150
|
+
export { ExpandedBankTransactionRow } from '@layerfi/components/components/ExpandedBankTransactionRow/ExpandedBankTransactionRow';
|
|
151
|
+
|
|
152
|
+
}
|
|
153
|
+
declare module '@layerfi/components/components/Hello/Hello' {
|
|
154
|
+
import React from 'react';
|
|
155
|
+
type Props = {
|
|
156
|
+
user?: string | undefined;
|
|
157
|
+
};
|
|
158
|
+
export const Hello: ({ user }: Props) => React.JSX.Element;
|
|
159
|
+
export {};
|
|
160
|
+
|
|
161
|
+
}
|
|
162
|
+
declare module '@layerfi/components/components/Hello/index' {
|
|
163
|
+
export { Hello } from '@layerfi/components/components/Hello/Hello';
|
|
164
|
+
|
|
165
|
+
}
|
|
166
|
+
declare module '@layerfi/components/components/Pill/Pill' {
|
|
167
|
+
import React, { PropsWithChildren } from 'react';
|
|
168
|
+
export const Pill: ({ children }: PropsWithChildren) => React.JSX.Element;
|
|
169
|
+
|
|
170
|
+
}
|
|
171
|
+
declare module '@layerfi/components/components/Pill/index' {
|
|
172
|
+
export { Pill } from '@layerfi/components/components/Pill/Pill';
|
|
173
|
+
|
|
174
|
+
}
|
|
175
|
+
declare module '@layerfi/components/components/ProfitAndLoss/ProfitAndLoss' {
|
|
176
|
+
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
|
+
const ProfitAndLoss: {
|
|
182
|
+
({ children }: PropsWithChildren): React.JSX.Element;
|
|
183
|
+
Chart: () => React.JSX.Element;
|
|
184
|
+
Context: React.Context<PNLContextType>;
|
|
185
|
+
DatePicker: () => React.JSX.Element;
|
|
186
|
+
Summaries: () => React.JSX.Element | null;
|
|
187
|
+
Table: () => React.JSX.Element;
|
|
188
|
+
};
|
|
189
|
+
export { ProfitAndLoss };
|
|
190
|
+
|
|
191
|
+
}
|
|
192
|
+
declare module '@layerfi/components/components/ProfitAndLoss/index' {
|
|
193
|
+
export { ProfitAndLoss } from '@layerfi/components/components/ProfitAndLoss/ProfitAndLoss';
|
|
194
|
+
|
|
195
|
+
}
|
|
196
|
+
declare module '@layerfi/components/components/ProfitAndLossChart/ProfitAndLossChart' {
|
|
197
|
+
import React from 'react';
|
|
198
|
+
export const ProfitAndLossChart: () => React.JSX.Element;
|
|
199
|
+
|
|
200
|
+
}
|
|
201
|
+
declare module '@layerfi/components/components/ProfitAndLossChart/index' {
|
|
202
|
+
export { ProfitAndLossChart } from '@layerfi/components/components/ProfitAndLossChart/ProfitAndLossChart';
|
|
203
|
+
|
|
204
|
+
}
|
|
205
|
+
declare module '@layerfi/components/components/ProfitAndLossDatePicker/ProfitAndLossDatePicker' {
|
|
206
|
+
import React from 'react';
|
|
207
|
+
export const ProfitAndLossDatePicker: () => React.JSX.Element;
|
|
208
|
+
|
|
209
|
+
}
|
|
210
|
+
declare module '@layerfi/components/components/ProfitAndLossDatePicker/index' {
|
|
211
|
+
export { ProfitAndLossDatePicker } from '@layerfi/components/components/ProfitAndLossDatePicker/ProfitAndLossDatePicker';
|
|
212
|
+
|
|
213
|
+
}
|
|
214
|
+
declare module '@layerfi/components/components/ProfitAndLossRow/ProfitAndLossRow' {
|
|
215
|
+
import React from 'react';
|
|
216
|
+
import { Direction } from '@layerfi/components/types';
|
|
217
|
+
import { LineItem } from '@layerfi/components/types/profit_and_loss';
|
|
218
|
+
type Props = {
|
|
219
|
+
variant?: string;
|
|
220
|
+
depth?: number;
|
|
221
|
+
maxDepth?: number;
|
|
222
|
+
lineItem?: LineItem | null;
|
|
223
|
+
direction?: Direction;
|
|
224
|
+
};
|
|
225
|
+
export const ProfitAndLossRow: ({ variant, lineItem, depth, maxDepth, direction, }: Props) => React.JSX.Element | null;
|
|
226
|
+
export {};
|
|
227
|
+
|
|
228
|
+
}
|
|
229
|
+
declare module '@layerfi/components/components/ProfitAndLossRow/index' {
|
|
230
|
+
export { ProfitAndLossRow } from '@layerfi/components/components/ProfitAndLossRow/ProfitAndLossRow';
|
|
231
|
+
|
|
232
|
+
}
|
|
233
|
+
declare module '@layerfi/components/components/ProfitAndLossSummaries/ProfitAndLossSummaries' {
|
|
234
|
+
import React from 'react';
|
|
235
|
+
export const ProfitAndLossSummaries: () => React.JSX.Element | null;
|
|
236
|
+
|
|
237
|
+
}
|
|
238
|
+
declare module '@layerfi/components/components/ProfitAndLossSummaries/index' {
|
|
239
|
+
export { ProfitAndLossSummaries } from '@layerfi/components/components/ProfitAndLossSummaries/ProfitAndLossSummaries';
|
|
240
|
+
|
|
241
|
+
}
|
|
242
|
+
declare module '@layerfi/components/components/ProfitAndLossTable/ProfitAndLossTable' {
|
|
243
|
+
import React from 'react';
|
|
244
|
+
export const ProfitAndLossTable: () => React.JSX.Element;
|
|
245
|
+
|
|
246
|
+
}
|
|
247
|
+
declare module '@layerfi/components/components/ProfitAndLossTable/index' {
|
|
248
|
+
export { ProfitAndLossTable } from '@layerfi/components/components/ProfitAndLossTable/ProfitAndLossTable';
|
|
249
|
+
|
|
250
|
+
}
|
|
251
|
+
declare module '@layerfi/components/components/RadioButtonGroup/RadioButton' {
|
|
252
|
+
import React from 'react';
|
|
253
|
+
type Props = {
|
|
254
|
+
checked: boolean;
|
|
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;
|
|
263
|
+
export {};
|
|
264
|
+
|
|
265
|
+
}
|
|
266
|
+
declare module '@layerfi/components/components/RadioButtonGroup/RadioButtonGroup' {
|
|
267
|
+
import React from 'react';
|
|
268
|
+
export type RadioButtonLabel = {
|
|
269
|
+
label: string;
|
|
270
|
+
value: string;
|
|
271
|
+
disabled?: boolean;
|
|
272
|
+
};
|
|
273
|
+
type Props = {
|
|
274
|
+
name: string;
|
|
275
|
+
size?: 'small' | 'large';
|
|
276
|
+
buttons: RadioButtonLabel[];
|
|
277
|
+
selected?: RadioButtonLabel['value'];
|
|
278
|
+
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
279
|
+
};
|
|
280
|
+
export const RadioButtonGroup: ({ name, size, buttons, onChange, selected, }: Props) => React.JSX.Element;
|
|
281
|
+
export {};
|
|
282
|
+
|
|
283
|
+
}
|
|
284
|
+
declare module '@layerfi/components/components/RadioButtonGroup/index' {
|
|
285
|
+
export { RadioButtonGroup } from '@layerfi/components/components/RadioButtonGroup/RadioButtonGroup';
|
|
286
|
+
|
|
287
|
+
}
|
|
288
|
+
declare module '@layerfi/components/contexts/LayerContext/LayerContext' {
|
|
289
|
+
/// <reference types="react" />
|
|
290
|
+
import { LayerContextValues } from '@layerfi/components/types';
|
|
291
|
+
export const LayerContext: import("react").Context<LayerContextValues>;
|
|
292
|
+
|
|
293
|
+
}
|
|
294
|
+
declare module '@layerfi/components/contexts/LayerContext/index' {
|
|
295
|
+
export { LayerContext } from '@layerfi/components/contexts/LayerContext/LayerContext';
|
|
296
|
+
|
|
297
|
+
}
|
|
298
|
+
declare module '@layerfi/components/hooks/useBankTransactions/index' {
|
|
299
|
+
export { useBankTransactions } from '@layerfi/components/hooks/useBankTransactions/useBankTransactions';
|
|
300
|
+
|
|
301
|
+
}
|
|
302
|
+
declare module '@layerfi/components/hooks/useBankTransactions/useBankTransactions' {
|
|
303
|
+
import { BankTransaction, CategoryUpdate, Metadata } from '@layerfi/components/types';
|
|
304
|
+
type UseBankTransactionsReturn = {
|
|
305
|
+
data: BankTransaction[];
|
|
306
|
+
metadata: Metadata;
|
|
307
|
+
isLoading: boolean;
|
|
308
|
+
error: unknown;
|
|
309
|
+
categorize: (id: BankTransaction['id'], newCategory: CategoryUpdate) => Promise<void>;
|
|
310
|
+
};
|
|
311
|
+
export const useBankTransactions: () => UseBankTransactionsReturn;
|
|
312
|
+
export {};
|
|
313
|
+
|
|
314
|
+
}
|
|
315
|
+
declare module '@layerfi/components/hooks/useLayerContext/index' {
|
|
316
|
+
export { useLayerContext } from '@layerfi/components/hooks/useLayerContext/useLayerContext';
|
|
317
|
+
|
|
318
|
+
}
|
|
319
|
+
declare module '@layerfi/components/hooks/useLayerContext/useLayerContext' {
|
|
320
|
+
export const useLayerContext: () => import("@layerfi/components/types").LayerContextValues;
|
|
321
|
+
|
|
322
|
+
}
|
|
323
|
+
declare module '@layerfi/components/hooks/useProfitAndLoss/index' {
|
|
324
|
+
export { useProfitAndLoss } from '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLoss';
|
|
325
|
+
|
|
326
|
+
}
|
|
327
|
+
declare module '@layerfi/components/hooks/useProfitAndLoss/useProfitAndLoss' {
|
|
328
|
+
import { ProfitAndLoss, DateRange } from '@layerfi/components/types';
|
|
329
|
+
type UseProfitAndLoss = {
|
|
330
|
+
data: ProfitAndLoss | undefined;
|
|
331
|
+
isLoading: boolean;
|
|
332
|
+
error: unknown;
|
|
333
|
+
dateRange: DateRange;
|
|
334
|
+
changeDateRange: (dateRange: Partial<DateRange>) => void;
|
|
335
|
+
};
|
|
336
|
+
type Props = DateRange;
|
|
337
|
+
export const useProfitAndLoss: ({ startDate: initialStartDate, endDate: initialEndDate }?: Props) => UseProfitAndLoss;
|
|
338
|
+
export {};
|
|
339
|
+
|
|
340
|
+
}
|
|
341
|
+
declare module '@layerfi/components/hooks/useWindowSize/useWindowSize' {
|
|
342
|
+
export function useWindowSize(): number[];
|
|
343
|
+
|
|
344
|
+
}
|
|
345
|
+
declare module '@layerfi/components/icons/CheckedCircle' {
|
|
346
|
+
import * as React from 'react';
|
|
347
|
+
import { SVGProps } from 'react';
|
|
348
|
+
type Props = SVGProps<SVGSVGElement> & {
|
|
349
|
+
size: SVGProps<SVGSVGElement>['width'];
|
|
350
|
+
fillColor: string;
|
|
351
|
+
strokeColor: string;
|
|
352
|
+
};
|
|
353
|
+
const CheckedCircle: ({ fillColor, strokeColor, size, ...props }: Props) => React.JSX.Element;
|
|
354
|
+
export default CheckedCircle;
|
|
355
|
+
|
|
356
|
+
}
|
|
357
|
+
declare module '@layerfi/components/icons/ChevronDown' {
|
|
358
|
+
import * as React from 'react';
|
|
359
|
+
import { SVGProps } from 'react';
|
|
360
|
+
const ChevronDown: (props: SVGProps<SVGSVGElement>) => React.JSX.Element;
|
|
361
|
+
export default ChevronDown;
|
|
362
|
+
|
|
363
|
+
}
|
|
364
|
+
declare module '@layerfi/components/icons/ChevronLeft' {
|
|
365
|
+
import * as React from 'react';
|
|
366
|
+
import { SVGProps } from 'react';
|
|
367
|
+
type Props = {
|
|
368
|
+
strokeColor?: string;
|
|
369
|
+
size?: number;
|
|
370
|
+
};
|
|
371
|
+
const ChevronLeft: ({ strokeColor, size, ...props }: Props & SVGProps<SVGSVGElement>) => React.JSX.Element;
|
|
372
|
+
export default ChevronLeft;
|
|
373
|
+
|
|
374
|
+
}
|
|
375
|
+
declare module '@layerfi/components/icons/ChevronRight' {
|
|
376
|
+
import * as React from 'react';
|
|
377
|
+
import { SVGProps } from 'react';
|
|
378
|
+
type Props = {
|
|
379
|
+
strokeColor?: string;
|
|
380
|
+
size?: number;
|
|
381
|
+
};
|
|
382
|
+
const ChavronRight: ({ strokeColor, size, ...props }: Props & SVGProps<SVGSVGElement>) => React.JSX.Element;
|
|
383
|
+
export default ChavronRight;
|
|
384
|
+
|
|
385
|
+
}
|
|
386
|
+
declare module '@layerfi/components/icons/ChevronUp' {
|
|
387
|
+
import * as React from 'react';
|
|
388
|
+
import { SVGProps } from 'react';
|
|
389
|
+
const ChevronUp: (props: SVGProps<SVGSVGElement>) => React.JSX.Element;
|
|
390
|
+
export default ChevronUp;
|
|
391
|
+
|
|
392
|
+
}
|
|
393
|
+
declare module '@layerfi/components/icons/Link' {
|
|
394
|
+
import * as React from 'react';
|
|
395
|
+
import { SVGProps } from 'react';
|
|
396
|
+
type Props = SVGProps<SVGSVGElement> & {
|
|
397
|
+
size: SVGProps<SVGSVGElement>['width'];
|
|
398
|
+
};
|
|
399
|
+
const Link: ({ size, ...props }: Props) => React.JSX.Element;
|
|
400
|
+
export default Link;
|
|
401
|
+
|
|
402
|
+
}
|
|
403
|
+
declare module '@layerfi/components/icons/LinkBroken' {
|
|
404
|
+
import * as React from 'react';
|
|
405
|
+
import { SVGProps } from 'react';
|
|
406
|
+
type Props = SVGProps<SVGSVGElement> & {
|
|
407
|
+
size: SVGProps<SVGSVGElement>['width'];
|
|
408
|
+
};
|
|
409
|
+
const LinkBroken: ({ size, ...props }: Props) => React.JSX.Element;
|
|
410
|
+
export default LinkBroken;
|
|
411
|
+
|
|
412
|
+
}
|
|
413
|
+
declare module '@layerfi/components/index' {
|
|
414
|
+
import { BankTransactions } from '@layerfi/components/components/BankTransactions/index';
|
|
415
|
+
import { Hello } from '@layerfi/components/components/Hello/index';
|
|
416
|
+
import { ProfitAndLoss } from '@layerfi/components/components/ProfitAndLoss/index';
|
|
417
|
+
import { LayerProvider } from '@layerfi/components/providers/LayerProvider/index';
|
|
418
|
+
export { Hello, BankTransactions, LayerProvider, ProfitAndLoss };
|
|
419
|
+
|
|
420
|
+
}
|
|
421
|
+
declare module '@layerfi/components/models/Money' {
|
|
422
|
+
export const centsToDollars: (cents: number) => string;
|
|
423
|
+
export const dollarsToCents: (dollars: string) => number;
|
|
424
|
+
const _default: {
|
|
425
|
+
centsToDollars: (cents: number) => string;
|
|
426
|
+
dollarsToCents: (dollars: string) => number;
|
|
427
|
+
};
|
|
428
|
+
export default _default;
|
|
429
|
+
|
|
430
|
+
}
|
|
431
|
+
declare module '@layerfi/components/providers/LayerProvider/LayerProvider' {
|
|
432
|
+
import React, { PropsWithChildren } from 'react';
|
|
433
|
+
type Props = {
|
|
434
|
+
businessId: string;
|
|
435
|
+
};
|
|
436
|
+
export const LayerProvider: ({ businessId, children, }: PropsWithChildren<Props>) => React.JSX.Element;
|
|
437
|
+
export {};
|
|
438
|
+
|
|
439
|
+
}
|
|
440
|
+
declare module '@layerfi/components/providers/LayerProvider/index' {
|
|
441
|
+
export { LayerProvider } from '@layerfi/components/providers/LayerProvider/LayerProvider';
|
|
442
|
+
|
|
443
|
+
}
|
|
444
|
+
declare module '@layerfi/components/types/api' {
|
|
445
|
+
export interface PaginationMetadata {
|
|
446
|
+
sort_by?: string;
|
|
447
|
+
sort_order: string;
|
|
448
|
+
cursor?: string;
|
|
449
|
+
has_more: boolean;
|
|
450
|
+
}
|
|
451
|
+
export type Metadata = {
|
|
452
|
+
pagination?: PaginationMetadata;
|
|
453
|
+
};
|
|
454
|
+
|
|
455
|
+
}
|
|
456
|
+
declare module '@layerfi/components/types/authentication' {
|
|
457
|
+
export type OAuthResponse = {
|
|
458
|
+
access_token: string;
|
|
459
|
+
token_type: string;
|
|
460
|
+
expires_in: number;
|
|
461
|
+
};
|
|
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
|
+
};
|
|
486
|
+
};
|
|
487
|
+
|
|
488
|
+
}
|
|
489
|
+
declare module '@layerfi/components/types/profit_and_loss' {
|
|
490
|
+
export interface ProfitAndLoss {
|
|
491
|
+
type: 'Profit_And_Loss';
|
|
492
|
+
business_id: string;
|
|
493
|
+
start_date: string;
|
|
494
|
+
end_date: string;
|
|
495
|
+
income: LineItem;
|
|
496
|
+
cost_of_goods_sold?: LineItem | null;
|
|
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;
|
|
504
|
+
fully_categorized: boolean;
|
|
505
|
+
}
|
|
506
|
+
export interface LineItem {
|
|
507
|
+
name?: String;
|
|
508
|
+
display_name: string;
|
|
509
|
+
value: number;
|
|
510
|
+
line_items?: LineItem[] | null;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
}
|
|
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';
|
|
519
|
+
export enum CategorizationStatus {
|
|
520
|
+
PENDING = "PENDING",
|
|
521
|
+
READY_FOR_INPUT = "READY_FOR_INPUT",
|
|
522
|
+
LAYER_REVIEW = "LAYER_REVIEW",
|
|
523
|
+
CATEGORIZED = "CATEGORIZED",
|
|
524
|
+
SPLIT = "SPLIT",
|
|
525
|
+
JOURNALING = "JOURNALING"
|
|
526
|
+
}
|
|
527
|
+
export enum Direction {
|
|
528
|
+
CREDIT = "CREDIT",
|
|
529
|
+
DEBIT = "DEBIT"
|
|
530
|
+
}
|
|
531
|
+
export interface Category {
|
|
532
|
+
id: string;
|
|
533
|
+
type: string;
|
|
534
|
+
display_name: string;
|
|
535
|
+
category: string;
|
|
536
|
+
stable_name?: string;
|
|
537
|
+
subCategories?: Category[];
|
|
538
|
+
}
|
|
539
|
+
export enum CategorizationType {
|
|
540
|
+
AUTO = "AUTO",
|
|
541
|
+
ASK_FROM_SUGGESTIONS = "ASK_FROM_SUGGESTIONS",
|
|
542
|
+
MEALS = "MEALS",
|
|
543
|
+
BUSINESS_TRAVEL_TRANSPORTATION = "BUSINESS_TRAVEL_TRANSPORTATION"
|
|
544
|
+
}
|
|
545
|
+
export interface AutoCategorization {
|
|
546
|
+
type: CategorizationType.AUTO;
|
|
547
|
+
category: Category;
|
|
548
|
+
}
|
|
549
|
+
export interface SuggestedCategorization {
|
|
550
|
+
type: CategorizationType;
|
|
551
|
+
suggestions: Category[];
|
|
552
|
+
}
|
|
553
|
+
export interface BankTransaction extends Record<string, unknown> {
|
|
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
|
+
}
|
|
571
|
+
export type SingleCategoryUpdate = {
|
|
572
|
+
type: 'Category';
|
|
573
|
+
category: {
|
|
574
|
+
type: 'StableName';
|
|
575
|
+
stable_name: string;
|
|
576
|
+
};
|
|
577
|
+
};
|
|
578
|
+
export type SplitCategoryUpdate = {
|
|
579
|
+
type: 'Split';
|
|
580
|
+
entries: {
|
|
581
|
+
category: string;
|
|
582
|
+
amount: number;
|
|
583
|
+
}[];
|
|
584
|
+
};
|
|
585
|
+
export type CategoryUpdate = SingleCategoryUpdate | SplitCategoryUpdate;
|
|
586
|
+
export type DateRange<T = Date> = {
|
|
587
|
+
startDate: T;
|
|
588
|
+
endDate: T;
|
|
589
|
+
};
|
|
590
|
+
|
|
591
|
+
}
|
|
592
|
+
declare module '@layerfi/components' {
|
|
593
|
+
import main = require('@layerfi/components/src/index');
|
|
594
|
+
export = main;
|
|
595
|
+
}
|