Skip to content

Commit 11dccd7

Browse files
authored
Add undefined to optional properties, part S (DefinitelyTyped#54313)
In preparation for exactOptionalPropertyTypes in Typescript 4.4, add undefined to all optional properties. #no-publishing-comment This PR covers packages starting with s-. microsoft/dtslint#335
1 parent b453d9d commit 11dccd7

File tree

73 files changed

+1515
-1515
lines changed

Some content is hidden

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

73 files changed

+1515
-1515
lines changed

types/s3-download-stream/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import { S3 } from "aws-sdk";
1111
declare namespace s3Stream {
1212
interface S3StreamDownloaderOptions {
1313
client: S3;
14-
concurrency?: number;
15-
chunkSize?: string;
14+
concurrency?: number | undefined;
15+
chunkSize?: string | undefined;
1616
params: S3.GetObjectRequest;
1717
}
1818
}

types/s3-streams/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export interface StreamOptions {
1616
* @default 4MB for {@link ReadStream}
1717
* @default 10MB for {@link WriteStream}
1818
*/
19-
highWaterMark?: number;
19+
highWaterMark?: number | undefined;
2020
}
2121

2222
export class ReadStream extends Readable {

types/s3-uploader/index.d.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,27 @@ export = Upload;
99

1010
declare namespace Upload {
1111
interface S3UploaderVersion {
12-
original?: boolean;
13-
suffix?: string;
14-
quality?: number;
15-
maxWidth?: number;
16-
maxHeight?: number;
12+
original?: boolean | undefined;
13+
suffix?: string | undefined;
14+
quality?: number | undefined;
15+
maxWidth?: number | undefined;
16+
maxHeight?: number | undefined;
1717
}
1818

1919
interface S3UploaderOptions {
20-
awsAccessKeyId?: string;
21-
awsSecretAccessKey?: string;
22-
awsBucketRegion?: string;
23-
awsBucketPath?: string;
24-
awsBucketAcl?: string;
25-
awsMaxRetries?: number;
26-
awsHttpTimeout?: number;
27-
resizeQuality?: number;
28-
returnExif?: boolean;
29-
tmpDir?: string;
30-
workers?: number;
31-
url?: string;
32-
versions?: S3UploaderVersion[];
20+
awsAccessKeyId?: string | undefined;
21+
awsSecretAccessKey?: string | undefined;
22+
awsBucketRegion?: string | undefined;
23+
awsBucketPath?: string | undefined;
24+
awsBucketAcl?: string | undefined;
25+
awsMaxRetries?: number | undefined;
26+
awsHttpTimeout?: number | undefined;
27+
resizeQuality?: number | undefined;
28+
returnExif?: boolean | undefined;
29+
tmpDir?: string | undefined;
30+
workers?: number | undefined;
31+
url?: string | undefined;
32+
versions?: S3UploaderVersion[] | undefined;
3333
}
3434

3535
interface Meta {

types/s3rver/index.d.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ declare class S3rver {
2424
}
2525

2626
interface S3rverOptions {
27-
port?: number;
28-
hostname?: string;
29-
address?: string;
30-
silent?: boolean;
31-
key?: string | Buffer;
32-
cert?: string | Buffer;
33-
resetOnClose?: boolean;
34-
indexDocument?: string;
35-
errorDocument?: string;
36-
configureBuckets?: S3rverBucketConfig[];
27+
port?: number | undefined;
28+
hostname?: string | undefined;
29+
address?: string | undefined;
30+
silent?: boolean | undefined;
31+
key?: string | Buffer | undefined;
32+
cert?: string | Buffer | undefined;
33+
resetOnClose?: boolean | undefined;
34+
indexDocument?: string | undefined;
35+
errorDocument?: string | undefined;
36+
configureBuckets?: S3rverBucketConfig[] | undefined;
3737
directory: string;
3838
}
3939

types/sade/index.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ declare namespace sade {
1919
* Optionally define one or more aliases for the current Command.
2020
* When declared, the `opts.alias` value is passed directly to the [`prog.alias`](#progaliasnames) method.
2121
*/
22-
alias?: string | string[];
23-
default?: boolean;
22+
alias?: string | string[] | undefined;
23+
default?: boolean | undefined;
2424
}
2525

2626
interface ParseOptions extends mri.Options {
27-
lazy?: boolean;
27+
lazy?: boolean | undefined;
2828
}
2929

3030
interface LazyOutput {

types/safe-regex/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
55

66
export = safe_regex;
7-
declare function safe_regex(re: string | RegExp, opts?: { limit?: number }): boolean;
7+
declare function safe_regex(re: string | RegExp, opts?: { limit?: number | undefined }): boolean;

types/sails.io.js/index.d.ts

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,36 @@
77

88
declare namespace SailsIOJS {
99
export interface SDKInfo {
10-
version?: string;
11-
language?: string;
12-
platform?: "browser" | "node";
13-
versionString?: string;
10+
version?: string | undefined;
11+
language?: string | undefined;
12+
platform?: "browser" | "node" | undefined;
13+
versionString?: string | undefined;
1414
}
1515
export interface ClientSails {
16-
url?: string;
17-
autoConnect?: boolean;
18-
headers?: { [index: string]: string };
19-
transports?: Array<"websocket" | "polling">;
20-
rejectUnauthorized?: boolean;
21-
reconnection?: boolean;
22-
reconnectionAttempts?: number;
23-
reconnectionDelay?: number;
24-
reconnectionDelayMax?: number;
25-
useCORSRouteToGetCookie?: boolean;
26-
query?: string;
27-
path?: string;
16+
url?: string | undefined;
17+
autoConnect?: boolean | undefined;
18+
headers?: { [index: string]: string } | undefined;
19+
transports?: Array<"websocket" | "polling"> | undefined;
20+
rejectUnauthorized?: boolean | undefined;
21+
reconnection?: boolean | undefined;
22+
reconnectionAttempts?: number | undefined;
23+
reconnectionDelay?: number | undefined;
24+
reconnectionDelayMax?: number | undefined;
25+
useCORSRouteToGetCookie?: boolean | undefined;
26+
query?: string | undefined;
27+
path?: string | undefined;
2828
// All logs are disabled when `io.sails.environment = 'production'`
29-
environment?: "production" | string;
29+
environment?: "production" | string | undefined;
3030
connect(url?: string, config?: ConnectConfig): Socket;
31-
initialConnectionHeaders?: InitialConnectionHeaders;
32-
strict?: boolean;
33-
sdk?: SDKInfo;
31+
initialConnectionHeaders?: InitialConnectionHeaders | undefined;
32+
strict?: boolean | undefined;
33+
sdk?: SDKInfo | undefined;
3434
}
3535
export interface ConnectConfig {
36-
initialConnectionHeaders?: InitialConnectionHeaders
36+
initialConnectionHeaders?: InitialConnectionHeaders | undefined
3737
}
3838
export interface InitialConnectionHeaders {
39-
nosession?: boolean;
39+
nosession?: boolean | undefined;
4040
[key: string]: unknown;
4141
}
4242
export interface Client {
@@ -46,16 +46,16 @@ declare namespace SailsIOJS {
4646
export interface Headers { [index: string]: string }
4747
export interface RequestOptions {
4848
url: string;
49-
method?: string;
50-
headers?: Headers;
49+
method?: string | undefined;
50+
headers?: Headers | undefined;
5151
params?: any;
5252
data?: any;
5353
}
5454
export interface JWR {
5555
headers: Headers;
5656
statusCode: number;
5757
body: any;
58-
error?: Error;
58+
error?: Error | undefined;
5959
toString: () => string;
6060
toPOJO: () => {
6161
body: any;

types/sailthru-client/index.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ export interface PurchaseItem {
2525
price: number;
2626
id: string | number;
2727
url: string;
28-
tags?: string[];
29-
vars?: object;
28+
tags?: string[] | undefined;
29+
vars?: object | undefined;
3030
images?: {
3131
full?: {
3232
url: string
33-
},
33+
} | undefined,
3434
thumb?: {
3535
url: string
36-
}
37-
};
36+
} | undefined
37+
} | undefined;
3838
}
3939

4040
export type SailthruResponse = object | string;

types/salesforce__canvas-js-sdk/index.d.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ declare namespace Sfdc {
99
namespace canvas {
1010
// see https://developer.salesforce.com/docs/atlas.en-us.platform_connect.meta/platform_connect/client_object.htm
1111
interface Client {
12-
readonly oauthToken?: string | null;
13-
readonly instanceId?: string | null;
14-
readonly instanceUrl?: string | null;
15-
readonly targetOrigin?: string | null;
16-
readonly refreshToken?: string | null;
12+
readonly oauthToken?: string | null | undefined;
13+
readonly instanceId?: string | null | undefined;
14+
readonly instanceUrl?: string | null | undefined;
15+
readonly targetOrigin?: string | null | undefined;
16+
readonly refreshToken?: string | null | undefined;
1717
}
1818

1919
interface Response<T> {
2020
readonly status: number;
21-
readonly payload?: T;
21+
readonly payload?: T | undefined;
2222
}
2323

2424
enum ApplicationOptions {
@@ -127,7 +127,7 @@ declare namespace Sfdc {
127127
interface Environment {
128128
readonly parameters: Record<string, unknown>;
129129
readonly dimensions: EnvironmentDimensions;
130-
readonly record?: EnvironmentRecord;
130+
readonly record?: EnvironmentRecord | undefined;
131131
readonly displayLocation: EnvironmentDisplayLocation;
132132
readonly locationUrl: string;
133133
readonly subLocation: EnvironmentDisplaySubLocation | null;
@@ -164,10 +164,10 @@ declare namespace Sfdc {
164164

165165
// see https://developer.salesforce.com/docs/atlas.en-us.platform_connect.meta/platform_connect/context_object.htm
166166
interface Context {
167-
readonly application?: Application;
168-
readonly user?: User;
167+
readonly application?: Application | undefined;
168+
readonly user?: User | undefined;
169169
readonly environment: Environment;
170-
readonly organization?: Organization;
170+
readonly organization?: Organization | undefined;
171171
readonly links: Links;
172172
}
173173

@@ -295,11 +295,11 @@ declare namespace Sfdc {
295295
interface AjaxSettings {
296296
readonly client: Client;
297297
readonly success: (data: Response<unknown>) => void;
298-
readonly method?: string;
299-
readonly async?: boolean;
300-
readonly contentType?: string;
301-
readonly headers?: Record<string, string>;
302-
readonly data?: string | null;
298+
readonly method?: string | undefined;
299+
readonly async?: boolean | undefined;
300+
readonly contentType?: string | undefined;
301+
readonly headers?: Record<string, string> | undefined;
302+
readonly data?: string | null | undefined;
303303
}
304304

305305
interface Version {
@@ -405,14 +405,14 @@ declare namespace Sfdc {
405405
readonly response_type: string;
406406
readonly client_id: string;
407407
readonly redirect_uri: string;
408-
readonly state?: string;
409-
readonly display?: string;
408+
readonly state?: string | undefined;
409+
readonly display?: string | undefined;
410410
}
411411

412412
interface LoginContext {
413413
readonly uri: string;
414414
readonly params: LoginParams;
415-
readonly callback?: string;
415+
readonly callback?: string | undefined;
416416
}
417417

418418
function init(): void;

0 commit comments

Comments
 (0)