Skip to content

Commit 4c91e27

Browse files
authored
Add undefined to optional properties, Abstract to Blueimp (DefinitelyTyped#54314)
* Add undefined to optional properties, Abstract to Blueimp In preparation for exactOptionalPropertyTypes in Typescript 4.4, add undefined to all optional properties. #no-publishing-comment This PR covers widely used packages (more than 100,000 downloads per month) from abstract-leveldown -- blueimp-load-image. microsoft/dtslint#335 * Fix bad automerges
1 parent b70b8e2 commit 4c91e27

File tree

93 files changed

+2238
-2238
lines changed

Some content is hidden

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

93 files changed

+2238
-2238
lines changed

types/abstract-leveldown/index.d.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ export type ErrorValueCallback<V> = (err: Error | undefined, value: V) => void;
1414
export type ErrorKeyValueCallback<K, V> = (err: Error | undefined, key: K, value: V) => void;
1515

1616
export interface AbstractOpenOptions extends AbstractOptions {
17-
createIfMissing?: boolean;
18-
errorIfExists?: boolean;
17+
createIfMissing?: boolean | undefined;
18+
errorIfExists?: boolean | undefined;
1919
}
2020

2121
export interface AbstractGetOptions extends AbstractOptions {
22-
asBuffer?: boolean;
22+
asBuffer?: boolean | undefined;
2323
}
2424

2525
export interface AbstractLevelDOWN<K = any, V = any> extends AbstractOptions {
@@ -56,16 +56,16 @@ export interface AbstractLevelDOWNConstructor {
5656
}
5757

5858
export interface AbstractIteratorOptions<K = any> extends AbstractOptions {
59-
gt?: K;
60-
gte?: K;
61-
lt?: K;
62-
lte?: K;
63-
reverse?: boolean;
64-
limit?: number;
65-
keys?: boolean;
66-
values?: boolean;
67-
keyAsBuffer?: boolean;
68-
valueAsBuffer?: boolean;
59+
gt?: K | undefined;
60+
gte?: K | undefined;
61+
lt?: K | undefined;
62+
lte?: K | undefined;
63+
reverse?: boolean | undefined;
64+
limit?: number | undefined;
65+
keys?: boolean | undefined;
66+
values?: boolean | undefined;
67+
keyAsBuffer?: boolean | undefined;
68+
valueAsBuffer?: boolean | undefined;
6969
}
7070

7171
export type AbstractBatch<K = any, V = any> = PutBatch<K, V> | DelBatch<K, V>;

types/accept-language-parser/index.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ export function pick<T extends string>(
1616

1717
export interface Language {
1818
code: string;
19-
script?: string | null;
20-
region?: string;
19+
script?: string | null | undefined;
20+
region?: string | undefined;
2121
quality: number;
2222
}
2323

2424
export interface PickOptions {
25-
loose?: boolean;
25+
loose?: boolean | undefined;
2626
}

types/accounting/index.d.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@
77
declare namespace accounting {
88
interface CurrencyFormat {
99
pos: string; // for positive values, eg. "$ 1.00"
10-
neg?: string; // for negative values, eg. "$ (1.00)"
11-
zero?: string; // for zero values, eg. "$ --"
10+
neg?: string | undefined; // for negative values, eg. "$ (1.00)"
11+
zero?: string | undefined; // for zero values, eg. "$ --"
1212
}
1313

1414
interface CurrencySettings<TFormat> {
15-
symbol?: string; // default currency symbol is '$'
16-
format?: TFormat; // controls output: %s = symbol, %v = value/number
17-
decimal?: string; // decimal point separator
18-
thousand?: string; // thousands separator
19-
precision?: number; // decimal places
15+
symbol?: string | undefined; // default currency symbol is '$'
16+
format?: TFormat | undefined; // controls output: %s = symbol, %v = value/number
17+
decimal?: string | undefined; // decimal point separator
18+
thousand?: string | undefined; // thousands separator
19+
precision?: number | undefined; // decimal places
2020
}
2121

2222
interface NumberSettings {
23-
precision?: number; // default precision on numbers is 0
24-
thousand?: string;
25-
decimal?: string;
23+
precision?: number | undefined; // default precision on numbers is 0
24+
thousand?: string | undefined;
25+
decimal?: string | undefined;
2626
}
2727

2828
interface Settings {

types/ace/index.d.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ declare namespace AceAjax {
1414
}
1515

1616
export interface EditorCommand {
17-
name?: string;
18-
bindKey?: string | { mac?: string, win?: string };
17+
name?: string | undefined;
18+
bindKey?: string | { mac?: string | undefined, win?: string | undefined } | undefined;
1919
exec: (editor: Editor, args?: any) => void;
20-
readOnly?: boolean;
20+
readOnly?: boolean | undefined;
2121
}
2222

2323
interface CommandMap {
@@ -52,7 +52,7 @@ declare namespace AceAjax {
5252
addCommands(commands: EditorCommand[]): void;
5353
removeCommand(command: EditorCommand | string, keepCommand?: boolean): void;
5454
removeCommands(command: EditorCommand[]): void;
55-
bindKey(key: string | { mac?: string, win?: string },
55+
bindKey(key: string | { mac?: string | undefined, win?: string | undefined },
5656
command: CommandLike,
5757
position?: number): void;
5858
bindKeys(keys: {[s: string]: Function}): void;
@@ -64,17 +64,17 @@ declare namespace AceAjax {
6464
}
6565

6666
export interface Annotation {
67-
row?: number;
68-
column?: number;
67+
row?: number | undefined;
68+
column?: number | undefined;
6969
text: string;
7070
type: string;
7171
}
7272

7373
export interface TokenInfo {
7474
type: string;
7575
value: string;
76-
index?: number;
77-
start?: number;
76+
index?: number | undefined;
77+
start?: number | undefined;
7878
}
7979

8080
export interface Position {
@@ -3088,18 +3088,18 @@ declare namespace AceAjax {
30883088
* Provides tooltip information about a completion result.
30893089
* @param item The completion result
30903090
*/
3091-
getDocTooltip?: (item: Completion) => void;
3091+
getDocTooltip?: ((item: Completion) => void) | undefined;
30923092
}
30933093

30943094
export interface Completion {
30953095
value: string;
30963096
meta: string;
3097-
type?: string;
3098-
caption?: string;
3097+
type?: string | undefined;
3098+
caption?: string | undefined;
30993099
snippet?: any;
3100-
score?: number;
3101-
exactMatch?: number;
3102-
docHTML?: string;
3100+
score?: number | undefined;
3101+
exactMatch?: number | undefined;
3102+
docHTML?: string | undefined;
31033103
}
31043104

31053105
export type CompletionCallback = (error: Error | null, results: Completion[]) => void;

types/acorn/index.d.ts

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,26 @@ declare namespace acorn {
1717
}
1818

1919
interface Options {
20-
ecmaVersion?: 3 | 5 | 6 | 7 | 8 | 2015 | 2016 | 2017;
21-
sourceType?: 'script' | 'module';
22-
onInsertedSemicolon?: (lastTokEnd: number, lastTokEndLoc?: ESTree.Position) => void;
23-
onTrailingComma?: (lastTokEnd: number, lastTokEndLoc?: ESTree.Position) => void;
24-
allowReserved?: boolean;
25-
allowReturnOutsideFunction?: boolean;
26-
allowImportExportEverywhere?: boolean;
27-
allowHashBang?: boolean;
28-
locations?: boolean;
29-
onToken?: ((token: Token) => any) | Token[];
20+
ecmaVersion?: 3 | 5 | 6 | 7 | 8 | 2015 | 2016 | 2017 | undefined;
21+
sourceType?: 'script' | 'module' | undefined;
22+
onInsertedSemicolon?: ((lastTokEnd: number, lastTokEndLoc?: ESTree.Position) => void) | undefined;
23+
onTrailingComma?: ((lastTokEnd: number, lastTokEndLoc?: ESTree.Position) => void) | undefined;
24+
allowReserved?: boolean | undefined;
25+
allowReturnOutsideFunction?: boolean | undefined;
26+
allowImportExportEverywhere?: boolean | undefined;
27+
allowHashBang?: boolean | undefined;
28+
locations?: boolean | undefined;
29+
onToken?: ((token: Token) => any) | Token[] | undefined;
3030
onComment?: ((
3131
isBlock: boolean, text: string, start: number, end: number, startLoc?: ESTree.Position,
3232
endLoc?: ESTree.Position
33-
) => void) | Comment[];
34-
ranges?: boolean;
35-
program?: ESTree.Program;
36-
sourceFile?: string;
37-
directSourceFile?: string;
38-
preserveParens?: boolean;
39-
plugins?: PlainObject;
33+
) => void) | Comment[] | undefined;
34+
ranges?: boolean | undefined;
35+
program?: ESTree.Program | undefined;
36+
sourceFile?: string | undefined;
37+
directSourceFile?: string | undefined;
38+
preserveParens?: boolean | undefined;
39+
plugins?: PlainObject | undefined;
4040
}
4141

4242
class Parser {
@@ -61,7 +61,7 @@ declare namespace acorn {
6161
class SourceLocation implements ESTree.SourceLocation {
6262
start: Position;
6363
end: Position;
64-
source?: string | null;
64+
source?: string | null | undefined;
6565

6666
constructor(p: Parser, start: Position, end: Position);
6767
}
@@ -72,22 +72,22 @@ declare namespace acorn {
7272
type: string;
7373
start: number;
7474
end: number;
75-
loc?: ESTree.SourceLocation;
76-
sourceFile?: string;
77-
range?: [number, number];
75+
loc?: ESTree.SourceLocation | undefined;
76+
sourceFile?: string | undefined;
77+
range?: [number, number] | undefined;
7878

7979
constructor(parser: Parser, pos: number, loc: number);
8080
}
8181

8282
interface TokeTypeConfig {
8383
keyword: string;
84-
beforeExpr?: boolean;
85-
startsExpr?: boolean;
86-
isLoop?: boolean;
87-
isAssign?: boolean;
88-
prefix?: boolean;
89-
postfix?: boolean;
90-
binop?: number;
84+
beforeExpr?: boolean | undefined;
85+
startsExpr?: boolean | undefined;
86+
isLoop?: boolean | undefined;
87+
isAssign?: boolean | undefined;
88+
prefix?: boolean | undefined;
89+
postfix?: boolean | undefined;
90+
binop?: number | undefined;
9191
}
9292

9393
class TokenType {
@@ -202,8 +202,8 @@ declare namespace acorn {
202202
interface AbstractToken {
203203
start: number;
204204
end: number;
205-
loc?: SourceLocation;
206-
range?: [number, number];
205+
loc?: SourceLocation | undefined;
206+
range?: [number, number] | undefined;
207207
}
208208

209209
interface Comment extends AbstractToken {

types/actioncable/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ declare module ActionCable {
4242
}
4343

4444
declare interface AppInterface {
45-
cable?: ActionCable.Cable;
46-
network?: ActionCable.Channel;
45+
cable?: ActionCable.Cable | undefined;
46+
network?: ActionCable.Channel | undefined;
4747
}
4848

4949
declare var App: AppInterface;

types/activestorage/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ export class DirectUpload {
1919
}
2020

2121
export interface DirectUploadDelegate {
22-
directUploadWillCreateBlobWithXHR?: (xhr: XMLHttpRequest) => void;
22+
directUploadWillCreateBlobWithXHR?: ((xhr: XMLHttpRequest) => void) | undefined;
2323

24-
directUploadWillStoreFileWithXHR?: (xhr: XMLHttpRequest) => void;
24+
directUploadWillStoreFileWithXHR?: ((xhr: XMLHttpRequest) => void) | undefined;
2525
}
2626

2727
export interface Blob {

types/agent-base/index.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ declare namespace Agent {
1515
) => void;
1616

1717
interface AgentOptions {
18-
timeout?: number;
19-
host?: string;
20-
port?: number;
18+
timeout?: number | undefined;
19+
host?: string | undefined;
20+
port?: number | undefined;
2121
[key: string]: any;
2222
}
2323

2424
interface Agent extends EventEmitter {
2525
_promisifiedCallback: boolean;
2626
timeout: number | null;
27-
options?: AgentOptions;
27+
options?: AgentOptions | undefined;
2828
callback: AgentCallback;
2929
addRequest: (req?: any, opts?: any) => void;
3030
freeSocket: (socket: any, opts: any) => void;

0 commit comments

Comments
 (0)