Skip to content

Commit a245f92

Browse files
authored
Add undefined to optional properties, part A (DefinitelyTyped#54357)
* Add undefined to optional properties, part A In preparation for exactOptionalPropertyTypes in Typescript 4.4, add undefined to all optional properties. #no-publishing-comment This PR covers non-widely used packages starting with a- and following. microsoft/dtslint#335 * reformat for shorter line length
1 parent cf3e8c9 commit a245f92

File tree

936 files changed

+22361
-22190
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

936 files changed

+22361
-22190
lines changed

types/3box/index.d.ts

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ declare namespace Box {
2222
}
2323

2424
interface Storage {
25-
all(opts?: { metadata?: boolean }): Promise<any[] | undefined>;
25+
all(opts?: { metadata?: boolean | undefined }): Promise<any[] | undefined>;
2626
get(key: string): Promise<any>;
2727
log(): StorageLog[];
2828
getMetadata(key: string): Promise<any>;
@@ -51,19 +51,19 @@ declare namespace Box {
5151
joinThread(
5252
name: string,
5353
opts?: {
54-
firstModerator?: string;
55-
members?: boolean;
56-
noAutoSub?: boolean;
57-
ghost?: boolean;
58-
ghostBacklogLimit?: number;
54+
firstModerator?: string | undefined;
55+
members?: boolean | undefined;
56+
noAutoSub?: boolean | undefined;
57+
ghost?: boolean | undefined;
58+
ghostBacklogLimit?: number | undefined;
5959
},
6060
): Promise<Thread>;
61-
joinThreadByAddress(address: string, name: string, opts?: { noAutoSub?: boolean }): Promise<Thread>;
61+
joinThreadByAddress(address: string, name: string, opts?: { noAutoSub?: boolean | undefined }): Promise<Thread>;
6262
createConfidentialThread(name: string): Promise<Thread>;
6363
subscribeThread(
6464
address: string,
6565
config: object,
66-
opts?: { name?: string; firstModerator?: string; members?: string },
66+
opts?: { name?: string | undefined; firstModerator?: string | undefined; members?: string | undefined },
6767
): Promise<Thread>;
6868
unsubscribeThread(address?: string): void;
6969
subscribedThreads(): void;
@@ -81,11 +81,11 @@ declare namespace Box {
8181
}
8282

8383
declare class Box {
84-
static getConfig(address: string, opts?: { profileServer?: string }): Promise<object>;
84+
static getConfig(address: string, opts?: { profileServer?: string | undefined }): Promise<object>;
8585
static idUtils: {
86-
verifyClaim(claim: string, opts?: { audience?: string }): Promise<object>;
86+
verifyClaim(claim: string, opts?: { audience?: string | undefined }): Promise<object>;
8787
isMuportDID(address: string): Promise<boolean>;
88-
isClaim(claim: string, opts?: { audience?: string }): Promise<boolean>;
88+
isClaim(claim: string, opts?: { audience?: string | undefined }): Promise<boolean>;
8989
};
9090

9191
DID: string;
@@ -101,16 +101,16 @@ declare class Box {
101101
address: string,
102102
ethereumProvider: any,
103103
opts?: {
104-
consentCallback?: () => void;
105-
pinningNode?: string;
104+
consentCallback?: (() => void) | undefined;
105+
pinningNode?: string | undefined;
106106
ipfs?: any;
107-
addressServer?: string;
107+
addressServer?: string | undefined;
108108
},
109109
): Promise<Box>;
110110
static isLoggedIn(address: string): boolean;
111111
static create(ethereumProvider: any): Promise<Box>;
112112

113-
openSpace(name: string, opts?: { consentCallback?: () => void; onSyncDone?: () => void }): Promise<Box.Space>;
113+
openSpace(name: string, opts?: { consentCallback?: (() => void) | undefined; onSyncDone?: (() => void) | undefined }): Promise<Box.Space>;
114114
auth(space: string[], user: { address: string }): void;
115115
syncDone: Promise<Box.Space>;
116116
onSyncDone(syncDoneFn: () => void): void;
@@ -119,24 +119,24 @@ declare class Box {
119119
static getProfile(
120120
address: string,
121121
opts?: {
122-
blocklist?: (address: string) => boolean;
123-
metadata?: string;
124-
addressServer?: string;
122+
blocklist?: ((address: string) => boolean) | undefined;
123+
metadata?: string | undefined;
124+
addressServer?: string | undefined;
125125
ipfs?: any;
126-
useCacheService?: boolean;
127-
profileServer?: string;
126+
useCacheService?: boolean | undefined;
127+
profileServer?: string | undefined;
128128
},
129129
): Promise<any>;
130-
static getProfiles(address: string, opts?: { profileServer?: string }): Promise<object>;
131-
static profileGraphQL(query: object, opts?: { graphqlServer?: string }): Promise<object>;
130+
static getProfiles(address: string, opts?: { profileServer?: string | undefined }): Promise<object>;
131+
static profileGraphQL(query: object, opts?: { graphqlServer?: string | undefined }): Promise<object>;
132132
static getVerifiedAccounts(profile: object): Promise<object>;
133133

134134
static getSpace(
135135
address: string,
136136
name: string,
137-
opts?: { blocklist?: any; metadata?: string; profileServer?: string },
137+
opts?: { blocklist?: any; metadata?: string | undefined; profileServer?: string | undefined },
138138
): Promise<object>;
139-
static listSpaces(address: string, opts?: { profileServer?: string }): Promise<object>;
139+
static listSpaces(address: string, opts?: { profileServer?: string | undefined }): Promise<object>;
140140

141141
public: Storage;
142142
private: Storage;
@@ -146,7 +146,7 @@ declare class Box {
146146
name: string,
147147
firstModerator: string,
148148
members: boolean,
149-
opts?: { profileServer?: string },
149+
opts?: { profileServer?: string | undefined },
150150
): Promise<Box.ThreadPost[]>;
151-
static getThreadByAddress(address: string, opts?: { profileServer?: string }): Promise<Box.ThreadPost[]>;
151+
static getThreadByAddress(address: string, opts?: { profileServer?: string | undefined }): Promise<Box.ThreadPost[]>;
152152
}

types/a2hs.js/index.d.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,50 +16,50 @@ declare namespace AddToHomeScreen {
1616
* Background color for container
1717
* @default '#f9f9f9'
1818
*/
19-
backgroundColor?: string;
19+
backgroundColor?: string | undefined;
2020
/**
2121
* Padding for container
2222
* @default '10px'
2323
*/
24-
padding?: string;
24+
padding?: string | undefined;
2525
/**
2626
* Shadow color for top of container
2727
* @default '#e9e9e9'
2828
*/
29-
shadowColor?: string;
29+
shadowColor?: string | undefined;
3030
/**
3131
* Shadow size for top of container
3232
* @default '10px'
3333
*/
34-
shadowSize?: string;
34+
shadowSize?: string | undefined;
3535
/**
3636
* Font family for content in container
3737
* @default '-apple-system, sans-serif'
3838
*/
39-
fontFamily?: string;
39+
fontFamily?: string | undefined;
4040
/**
4141
* Font color for content in container
4242
* @default '#5d5d5d'
4343
*/
44-
color?: string;
44+
color?: string | undefined;
4545
/**
4646
* Font size for content in container
4747
* @default '0.9rem'
4848
*/
49-
fontSize?: string;
49+
fontSize?: string | undefined;
5050
/**
5151
* Brand for default `htmlContent`
5252
* @default ''
5353
*/
54-
brandName?: string;
54+
brandName?: string | undefined;
5555
/**
5656
* Logo for container
5757
*/
58-
logoImage?: string;
58+
logoImage?: string | undefined;
5959
/**
6060
* Content for container with HTML
6161
*/
62-
htmlContent?: string;
62+
htmlContent?: string | undefined;
6363
}
6464
}
6565
export = AddToHomeScreen;

types/absinthe__socket/index.d.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ export type RequestStatus = 'canceled' | 'canceling' | 'pending' | 'sent' | 'sen
1818

1919
export interface GqlRequest<Variables> {
2020
operation: string;
21-
variables?: Variables;
21+
variables?: Variables | undefined;
2222
}
2323

2424
export interface Observer<Variables = {}, Result = {}> {
25-
onAbort?: (error: Error) => any;
26-
onCancel?: () => any;
27-
onError?: (error: Error) => any;
28-
onStart?: (notifier: Notifier<Variables>) => any;
29-
onResult?: (result: Result) => any;
25+
onAbort?: ((error: Error) => any) | undefined;
26+
onCancel?: (() => any) | undefined;
27+
onError?: ((error: Error) => any) | undefined;
28+
onStart?: ((notifier: Notifier<Variables>) => any) | undefined;
29+
onResult?: ((result: Result) => any) | undefined;
3030
}
3131

3232
export interface Notifier<Variables = {}, Result = {}> {
@@ -36,7 +36,7 @@ export interface Notifier<Variables = {}, Result = {}> {
3636
operationType: GqlOperationType;
3737
request: GqlRequest<Variables>;
3838
requestStatus: RequestStatus;
39-
subscriptionId?: string;
39+
subscriptionId?: string | undefined;
4040
}
4141
/** Cancels a notifier sending a Cancel event to all its observers and unsubscribing in case it holds a subscription request */
4242
export function cancel(absintheSocket: AbsintheSocket, notifier: Notifier): AbsintheSocket;

types/accedo__accedo-one/index.d.ts

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -282,19 +282,19 @@ declare namespace AccedoLog {
282282
message: string;
283283

284284
/** The error code (max 5 digits) */
285-
errorCode?: number;
285+
errorCode?: number | undefined;
286286

287287
/** The dimension 1 information */
288-
dim1?: string;
288+
dim1?: string | undefined;
289289

290290
/** The dimension 2 information */
291-
dim2?: string;
291+
dim2?: string | undefined;
292292

293293
/** The dimension 3 information */
294-
dim3?: string;
294+
dim3?: string | undefined;
295295

296296
/** The dimension 4 information */
297-
dim4?: string;
297+
dim4?: string | undefined;
298298
}
299299

300300
interface Logobject extends Details {
@@ -319,38 +319,38 @@ declare namespace AccedoLog {
319319

320320
interface AccedoEntryParams {
321321
/** when true, get the preview version */
322-
preview?: boolean;
322+
preview?: boolean | undefined;
323323

324324
/** when given, get the version at the given time */
325-
at?: string | Date;
325+
at?: string | Date | undefined;
326326

327327
/** an array of entry ids (strings) */
328-
id?: string[];
328+
id?: string[] | undefined;
329329

330330
/** an array of entry aliases (strings) */
331-
alias?: string[];
331+
alias?: string[] | undefined;
332332

333333
/** only return entries of the given type ids (strings) */
334-
typeId?: string[];
334+
typeId?: string[] | undefined;
335335

336336
/** only return entries whose entry type has this alias */
337-
typeAlias?: string;
337+
typeAlias?: string | undefined;
338338

339339
/**
340340
* Limit to that many results per page (limits as per Accedo
341341
* One API, currently 1 to 50, default 20)
342342
*/
343-
size?: number | string;
343+
size?: number | string | undefined;
344344

345345
/** Offset the result by that many pages */
346-
offset?: number | string;
346+
offset?: number | string | undefined;
347347

348348
/**
349349
* if available, get the version for the given locale
350350
* (defaults to the default locale)
351351
*/
352352

353-
locale?: string;
353+
locale?: string | undefined;
354354
}
355355

356356
interface AccedoProfile {
@@ -367,34 +367,34 @@ interface AccedoConfig {
367367
* onDeviceIdGenerated, onSessionKeyChanged)
368368
*/
369369

370-
browserInfoProvider?: () => {
370+
browserInfoProvider?: (() => {
371371
deviceId: string;
372372
sessionKey: string;
373-
};
373+
}) | undefined;
374374

375375
/** The application Key */
376376
appKey: string;
377377

378378
/** The device identifier (if not provided, a uuid will be generated instead) */
379-
deviceId?: string;
379+
deviceId?: string | undefined;
380380

381381
/** The sessionKey (note a new one may be created when not given or expired) */
382-
sessionKey?: string;
382+
sessionKey?: string | undefined;
383383

384384
/** the user's IP, given to Accedo One for every request this client will trigger (for geolocation). */
385-
ip?: string;
385+
ip?: string | undefined;
386386

387387
/** A function to use to see this SDK's logs */
388-
log?: (...args: any[]) => void;
388+
log?: ((...args: any[]) => void) | undefined;
389389

390390
/** Callback to obtain the new deviceId, if one gets generated */
391-
onDeviceIdGenerated?: (deviceId: string) => void;
391+
onDeviceIdGenerated?: ((deviceId: string) => void) | undefined;
392392

393393
/** Callback to obtain the sessionKey, anytime a new one gets generated */
394-
onSessionKeyChanged?: (sessionKey: string) => void;
394+
onSessionKeyChanged?: ((sessionKey: string) => void) | undefined;
395395

396396
/** All APIs calls will use this as the base API URL (defaults to the Accedo One API URL) */
397-
target?: string;
397+
target?: string | undefined;
398398
}
399399

400400
interface AccedoLocale {

0 commit comments

Comments
 (0)