Skip to content

Commit c9c4f05

Browse files
authored
Add undefined to optional properties, Regenerator to Rimraf (DefinitelyTyped#54353)
In preparation for exactOptionalPropertyTypes in Typescript 4.4, add undefined to all optional properties. #no-publishing-comment This PR covers widely used packages, those with more then 100,000 packages per month, from regenerator -- rimraf. microsoft/dtslint#335
1 parent 694c663 commit c9c4f05

File tree

39 files changed

+634
-634
lines changed

39 files changed

+634
-634
lines changed

types/regenerator-runtime/index.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ export interface CompletionRecord {
3333

3434
export interface TryEntry {
3535
readonly tryLoc: number;
36-
readonly catchLoc?: number;
37-
readonly finallyLoc?: number;
38-
readonly afterLoc?: ContextLocation;
39-
completion?: CompletionRecord;
36+
readonly catchLoc?: number | undefined;
37+
readonly finallyLoc?: number | undefined;
38+
readonly afterLoc?: ContextLocation | undefined;
39+
completion?: CompletionRecord | undefined;
4040
}
4141

4242
export interface DelegatedIterator {

types/registry-auth-token/index.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ declare namespace auth {
1717
* Wether or not url's path parts are recursively trimmed from the registry
1818
* url when searching for tokens
1919
*/
20-
recursive?: boolean;
20+
recursive?: boolean | undefined;
2121
/**
2222
* An npmrc configuration object used when searching for tokens. If no object is provided,
2323
* the `.npmrc` file at the base of the project is used.
@@ -26,12 +26,12 @@ declare namespace auth {
2626
/**
2727
* A registry url used for matching
2828
*/
29-
registry?: string;
29+
registry?: string | undefined;
3030
/**
3131
* Registry url's with token information
3232
*/
3333
[registryUrls: string]: string | undefined;
34-
};
34+
} | undefined;
3535
}
3636
/**
3737
* The generated authentication information
@@ -48,11 +48,11 @@ declare namespace auth {
4848
/**
4949
* The username used in `Basic`
5050
*/
51-
username?: string;
51+
username?: string | undefined;
5252
/**
5353
* The password used in `Basic`
5454
*/
55-
password?: string;
55+
password?: string | undefined;
5656
}
5757
}
5858

types/regression/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ export interface Options {
1414
* This is used to round the calculated fitting coefficients,
1515
* the output predictions, and the value of r^2.
1616
*/
17-
precision?: number;
17+
precision?: number | undefined;
1818
/**
1919
* The number of terms to solve for (and therefore
2020
* the number of coefficients to calculate). Only
2121
* relevant for polynomial fitting.
2222
*/
23-
order?: number;
23+
order?: number | undefined;
2424
}
2525

2626
export interface Result {

types/relateurl/index.d.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,23 @@ declare namespace RelateUrl {
1212
*
1313
* Extend the list with any ports you need. Any URLs containing these default ports will have them removed. Example: http://example.com:80/ will become http://example.com/.
1414
*/
15-
defaultPorts?: Object;
15+
defaultPorts?: Object | undefined;
1616

1717
/**
1818
* Type: Array
1919
* Default value: ["index.html"]
2020
*
2121
* Extend the list with any resources you need. Works with options.removeDirectoryIndexes.
2222
*/
23-
directoryIndexes?: Array<string>;
23+
directoryIndexes?: Array<string> | undefined;
2424

2525
/**
2626
* Type: Boolean
2727
* Default value: false
2828
*
2929
* This will, for example, consider any domains containing http://www.example.com/ to be related to any that contain http://example.com/.
3030
*/
31-
ignore_www?: boolean;
31+
ignore_www?: boolean | undefined;
3232

3333
/**
3434
* Type: constant or String
@@ -41,71 +41,71 @@ declare namespace RelateUrl {
4141
* RelateUrl.ROOT_RELATIVE will produce something like /child-of-root/etc/.
4242
* RelateUrl.SHORTEST will choose whichever is shortest between root- and path-relative.
4343
*/
44-
output?: string;
44+
output?: string | undefined;
4545

4646
/**
4747
* Type: Array
4848
* Default value: ["data","javascript","mailto"]
4949
*
5050
* Extend the list with any additional schemes. Example: javascript:something will not be modified.
5151
*/
52-
rejectedSchemes?: Array<string>;
52+
rejectedSchemes?: Array<string> | undefined;
5353

5454
/**
5555
* Type: Boolean
5656
* Default value: false
5757
*
5858
* Remove user authentication information from the output URL.
5959
*/
60-
removeAuth?: boolean;
60+
removeAuth?: boolean | undefined;
6161

6262
/**
6363
* Type: Boolean
6464
* Default value: true
6565
*
6666
* Remove any resources that match any found in options.directoryIndexes.
6767
*/
68-
removeDirectoryIndexes?: boolean;
68+
removeDirectoryIndexes?: boolean | undefined;
6969

7070
/**
7171
* Type: Boolean
7272
* Default value: false
7373
*
7474
* Remove empty query variables. Example: http://domain.com/?var1&var2=&var3=asdf will become http://domain.com/?var3=adsf. This does not apply to unrelated URLs (with other protocols, auths, hosts and/or ports).
7575
*/
76-
removeEmptyQueries?: boolean;
76+
removeEmptyQueries?: boolean | undefined;
7777

7878
/**
7979
* Type: Boolean
8080
* Default value: true
8181
*
8282
* Remove trailing slashes from root paths. Example: http://domain.com/?var will become http://domain.com?var while http://domain.com/dir/?var will not be modified.
8383
*/
84-
removeRootTrailingSlash?: boolean;
84+
removeRootTrailingSlash?: boolean | undefined;
8585

8686
/**
8787
* Type: Boolean
8888
* Default value: true
8989
*
9090
* Output URLs relative to the scheme. Example: http://example.com/ will become //example.com/.
9191
*/
92-
schemeRelative?: boolean;
92+
schemeRelative?: boolean | undefined;
9393

9494
/**
9595
* Type: String
9696
* Default value: undefined
9797
*
9898
* An options-based version of the from argument. If both are specified, from takes priority.
9999
*/
100-
site?: string;
100+
site?: string | undefined;
101101

102102
/**
103103
* Type: Boolean
104104
* Default value: true
105105
*
106106
* Passed to Node's url.parse.
107107
*/
108-
slashesDenoteHost?: boolean;
108+
slashesDenoteHost?: boolean | undefined;
109109
}
110110
}
111111

types/relaxed-json/index.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ export type Reviver = (this: {}, key: string, value: any) => any;
77
export function transform(text: string): string;
88
export function parse(text: string, reviver: Reviver): {};
99
export function parse(text: string, opts?: {
10-
reviver?: Reviver,
11-
relaxed?: boolean,
12-
warnings?: boolean,
13-
tolerant?: boolean,
14-
duplicate?: boolean,
10+
reviver?: Reviver | undefined,
11+
relaxed?: boolean | undefined,
12+
warnings?: boolean | undefined,
13+
tolerant?: boolean | undefined,
14+
duplicate?: boolean | undefined,
1515
}): {};
1616
export function stringify(obj: any): string;

types/relay-runtime/lib/handlers/connection/ConnectionHandler.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export interface ConnectionMetadata {
1111
direction: string | null | undefined; // 'forward' | 'backward' | 'bidirectional' | null | undefined;
1212
cursor: string | null | undefined;
1313
count: string | null | undefined;
14-
stream?: boolean;
14+
stream?: boolean | undefined;
1515
}
1616

1717
export function buildConnectionEdge(

types/relay-runtime/lib/mutations/RelayDeclarativeMutationConfig.d.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,36 +13,36 @@ export type RangeBehaviors = RangeBehaviorsFunction | RangeBehaviorsObject;
1313

1414
export interface RangeAddConfig {
1515
type: 'RANGE_ADD';
16-
parentName?: string;
17-
parentID?: string;
16+
parentName?: string | undefined;
17+
parentID?: string | undefined;
1818
connectionInfo?: ReadonlyArray<{
1919
key: string;
20-
filters?: Variables;
20+
filters?: Variables | undefined;
2121
rangeBehavior: string;
22-
}>;
23-
connectionName?: string;
22+
}> | undefined;
23+
connectionName?: string | undefined;
2424
edgeName: string;
25-
rangeBehaviors?: RangeBehaviors;
25+
rangeBehaviors?: RangeBehaviors | undefined;
2626
}
2727

2828
export interface RangeDeleteConfig {
2929
type: 'RANGE_DELETE';
30-
parentName?: string;
31-
parentID?: string;
30+
parentName?: string | undefined;
31+
parentID?: string | undefined;
3232
connectionKeys?: ReadonlyArray<{
3333
key: string;
34-
filters?: Variables;
35-
}>;
36-
connectionName?: string;
34+
filters?: Variables | undefined;
35+
}> | undefined;
36+
connectionName?: string | undefined;
3737
deletedIDFieldName: string | ReadonlyArray<string>;
3838
pathToConnection: ReadonlyArray<string>;
3939
}
4040

4141
export interface NodeDeleteConfig {
4242
type: 'NODE_DELETE';
43-
parentName?: string;
44-
parentID?: string;
45-
connectionName?: string;
43+
parentName?: string | undefined;
44+
parentID?: string | undefined;
45+
connectionName?: string | undefined;
4646
deletedIDFieldName: string;
4747
}
4848

types/relay-runtime/lib/mutations/applyOptimisticMutation.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import { GraphQLTaggedNode } from '../query/RelayModernGraphQLTag';
44
import { SelectorStoreUpdater, Environment } from '../store/RelayStoreTypes';
55

66
export interface OptimisticMutationConfig {
7-
configs?: ReadonlyArray<DeclarativeMutationConfig> | null;
7+
configs?: ReadonlyArray<DeclarativeMutationConfig> | null | undefined;
88
mutation: GraphQLTaggedNode;
99
variables: Variables;
10-
optimisticUpdater?: SelectorStoreUpdater | null;
11-
optimisticResponse?: object;
10+
optimisticUpdater?: SelectorStoreUpdater | null | undefined;
11+
optimisticResponse?: object | undefined;
1212
}
1313

1414
/**

types/relay-runtime/lib/mutations/commitMutation.d.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@ import { Environment, SelectorStoreUpdater } from '../store/RelayStoreTypes';
77
export interface MutationParameters {
88
readonly response: {};
99
readonly variables: {};
10-
readonly rawResponse?: {};
10+
readonly rawResponse?: {} | undefined;
1111
}
1212

1313
export interface MutationConfig<TOperation extends MutationParameters> {
14-
configs?: DeclarativeMutationConfig[];
15-
cacheConfig?: CacheConfig;
14+
configs?: DeclarativeMutationConfig[] | undefined;
15+
cacheConfig?: CacheConfig | undefined;
1616
mutation: GraphQLTaggedNode;
17-
onError?: ((error: Error) => void) | null;
17+
onError?: ((error: Error) => void) | null | undefined;
1818
onCompleted?:
1919
| ((response: TOperation['response'], errors: ReadonlyArray<PayloadError> | null | undefined) => void)
20-
| null;
21-
onUnsubscribe?: () => void | null | undefined;
22-
optimisticResponse?: TOperation['response'];
23-
optimisticUpdater?: SelectorStoreUpdater<TOperation['response']> | null;
24-
updater?: SelectorStoreUpdater<TOperation['response']> | null;
25-
uploadables?: UploadableMap | null;
20+
| null | undefined;
21+
onUnsubscribe?: (() => void | null | undefined) | undefined;
22+
optimisticResponse?: TOperation['response'] | undefined;
23+
optimisticUpdater?: SelectorStoreUpdater<TOperation['response']> | null | undefined;
24+
updater?: SelectorStoreUpdater<TOperation['response']> | null | undefined;
25+
uploadables?: UploadableMap | null | undefined;
2626
variables: TOperation['variables'];
2727
}
2828

types/relay-runtime/lib/network/RelayNetworkTypes.d.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ export interface PayloadError {
2020
locations?: Array<{
2121
line: number;
2222
column: number;
23-
}>;
24-
severity?: 'CRITICAL' | 'ERROR' | 'WARNING'; // Not officially part of the spec, but used at Facebook
23+
}> | undefined;
24+
severity?: 'CRITICAL' | 'ERROR' | 'WARNING' | undefined; // Not officially part of the spec, but used at Facebook
2525
}
2626

2727
export interface PayloadExtensions {
@@ -34,17 +34,17 @@ export interface PayloadExtensions {
3434
*/
3535
export interface GraphQLResponseWithData {
3636
data: PayloadData;
37-
errors?: PayloadError[];
38-
extensions?: PayloadExtensions;
39-
label?: string;
40-
path?: Array<string | number>;
37+
errors?: PayloadError[] | undefined;
38+
extensions?: PayloadExtensions | undefined;
39+
label?: string | undefined;
40+
path?: Array<string | number> | undefined;
4141
}
4242
export interface GraphQLResponseWithoutData {
43-
data?: PayloadData;
43+
data?: PayloadData | undefined;
4444
errors: PayloadError[];
45-
extensions?: PayloadExtensions;
46-
label?: string;
47-
path?: Array<string | number>;
45+
extensions?: PayloadExtensions | undefined;
46+
label?: string | undefined;
47+
path?: Array<string | number> | undefined;
4848
}
4949
export interface GraphQLResponseWithExtensionsOnly {
5050
// Per https://spec.graphql.org/June2018/#sec-Errors
@@ -91,9 +91,9 @@ export type FetchFunction = (
9191
) => ObservableFromValue<GraphQLResponse>;
9292

9393
export interface LegacyObserver<T> {
94-
onCompleted?: () => void;
95-
onError?: (error: Error) => void;
96-
onNext?: (data: T) => void;
94+
onCompleted?: (() => void) | undefined;
95+
onError?: ((error: Error) => void) | undefined;
96+
onNext?: ((data: T) => void) | undefined;
9797
}
9898

9999
/**

0 commit comments

Comments
 (0)