-
Notifications
You must be signed in to change notification settings - Fork 24
/
global.d.ts
61 lines (54 loc) · 1.63 KB
/
global.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import React from 'react';
import { SputnikWalletErrorCodes } from 'errors/SputnikWalletError';
import { Config } from 'types/config';
type SputnikRequestSignInCompleted = (result: {
accountId?: string;
errorCode?: SputnikWalletErrorCodes;
allKeys?: string;
publicKey?: string;
}) => Promise<void>;
export type TransactionCompleted = {
transactionHashes?: string;
errorCode?: SputnikWalletErrorCodes;
};
export type SelectorTransactionCompleted = TransactionCompleted & {
accountId: string;
};
type SputnikRequestSignTransactionCompleted = (
result: TransactionCompleted
) => void;
declare global {
interface Window {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
fabric: any;
onLogin?: () => Promise<unknown>;
onTransaction?: (data: SelectorTransactionCompleted) => Promise<void>;
sputnikRequestSignInCompleted?: SputnikRequestSignInCompleted;
sputnikRequestSignTransactionCompleted?: SputnikRequestSignTransactionCompleted;
opener: {
sputnikRequestSignInCompleted?: SputnikRequestSignInCompleted;
sputnikRequestSignTransactionCompleted?: SputnikRequestSignTransactionCompleted;
};
near: SenderWalletInstance;
APP_CONFIG: Config;
gtag: (
type: 'event',
name: string,
params: Record<string, string | number | string[]>
) => void;
}
}
declare module 'react' {
interface StyleHTMLAttributes<T> extends React.HTMLAttributes<T> {
jsx?: boolean;
global?: boolean;
}
}
declare module 'yup' {
interface ArraySchema<T> {
unique(
message: string,
mapper?: (value: T, index?: number, list?: T[]) => T[]
): ArraySchema<T>;
}
}