-
Notifications
You must be signed in to change notification settings - Fork 0
/
SAMKeychain.d.ts
116 lines (66 loc) · 2.95 KB
/
SAMKeychain.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
declare class SAMKeychain extends NSObject {
static accessibilityType(): any;
static accountsForService(serviceName: string): NSArray<NSDictionary<string, any>>;
static accountsForServiceError(serviceName: string): NSArray<NSDictionary<string, any>>;
static allAccounts(): NSArray<NSDictionary<string, any>>;
/**
* Returns a new instance of the receiving class.
*/
static alloc(): SAMKeychain; // inherited from NSObject
static deletePasswordForServiceAccount(serviceName: string, account: string): boolean;
static deletePasswordForServiceAccountError(serviceName: string, account: string): boolean;
/**
* Allocates a new instance of the receiving class, sends it an init message, and returns the initialized object.
*/
static new(): SAMKeychain; // inherited from NSObject
static passwordDataForServiceAccount(serviceName: string, account: string): NSData;
static passwordDataForServiceAccountError(serviceName: string, account: string): NSData;
static passwordForServiceAccount(serviceName: string, account: string): string;
static passwordForServiceAccountError(serviceName: string, account: string): string;
static setAccessibilityType(accessibilityType: any): void;
static setPasswordDataForServiceAccount(password: NSData, serviceName: string, account: string): boolean;
static setPasswordDataForServiceAccountError(password: NSData, serviceName: string, account: string): boolean;
static setPasswordForServiceAccount(password: string, serviceName: string, account: string): boolean;
static setPasswordForServiceAccountError(password: string, serviceName: string, account: string): boolean;
}
declare const enum SAMKeychainErrorCode {
BadArguments = -1001
}
declare class SAMKeychainQuery extends NSObject {
/**
* Returns a new instance of the receiving class.
*/
static alloc(): SAMKeychainQuery; // inherited from NSObject
static isSynchronizationAvailable(): boolean;
/**
* Allocates a new instance of the receiving class, sends it an init message, and returns the initialized object.
*/
static new(): SAMKeychainQuery; // inherited from NSObject
accessGroup: string;
account: string;
label: string;
password: string;
passwordData: NSData;
passwordObject: NSCoding;
service: string;
synchronizationMode: SAMKeychainQuerySynchronizationMode;
deleteItem(): boolean;
fetch(): boolean;
fetchAll(): NSArray<NSDictionary<string, any>>;
save(): boolean;
}
declare const enum SAMKeychainQuerySynchronizationMode {
Any = 0,
No = 1,
Yes = 2
}
declare var SAMKeychainVersionNumber: number;
declare var SAMKeychainVersionString: interop.Reference<number>;
declare var kSAMKeychainAccountKey: string;
declare var kSAMKeychainClassKey: string;
declare var kSAMKeychainCreatedAtKey: string;
declare var kSAMKeychainDescriptionKey: string;
declare var kSAMKeychainErrorDomain: string;
declare var kSAMKeychainLabelKey: string;
declare var kSAMKeychainLastModifiedKey: string;
declare var kSAMKeychainWhereKey: string;