Skip to content

Commit

Permalink
Add undefined to optional properties, part X (DefinitelyTyped#54244)
Browse files Browse the repository at this point in the history
In preparation for exactOptionalPropertyTypes in Typescript 4.4, add
undefined to all optional properties. #no-publishing-comment

This PR covers packages starting with x-.
microsoft/dtslint#335
  • Loading branch information
sandersn authored Jul 2, 2021
1 parent dbded4e commit a46c575
Show file tree
Hide file tree
Showing 27 changed files with 402 additions and 402 deletions.
2 changes: 1 addition & 1 deletion types/x-axios-progress-bar/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ export function loadProgressBar(

declare module "axios" {
interface AxiosRequestConfig {
progress?: boolean;
progress?: boolean | undefined;
}
}
30 changes: 15 additions & 15 deletions types/x-editable/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,29 @@

interface XEditableOptions {
ajaxOptions?: any;
anim?: string;
autotext?: string;
anim?: string | undefined;
autotext?: string | undefined;
defaultValue?: any;
disabled?: boolean;
disabled?: boolean | undefined;
display?: any;
emptyclass?: string;
emptytext?: string;
emptyclass?: string | undefined;
emptytext?: string | undefined;
error?: any;
highlight?: any;
mode?: string;
name?: string;
onblur?: string;
mode?: string | undefined;
name?: string | undefined;
onblur?: string | undefined;
params?: any;
pk?: any;
placement?: string;
savenochange?: boolean;
selector?: string;
send?: string;
placement?: string | undefined;
savenochange?: boolean | undefined;
selector?: string | undefined;
send?: string | undefined;
showbuttons?: any;
success?: any;
toggle?: string;
type?: string;
unsavedclass?: string;
toggle?: string | undefined;
type?: string | undefined;
unsavedclass?: string | undefined;
url?: any;
validate?: any;
value?: any;
Expand Down
2 changes: 1 addition & 1 deletion types/xar/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface TOCHeader {
export type Compression = 'none' | 'gzip';

export interface PackOptions {
compression?: Compression;
compression?: Compression | undefined;
}

export type ExtractCallback = (error: Error | null, file: Record<string, any>, content?: string) => void;
Expand Down
6 changes: 3 additions & 3 deletions types/xast/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export interface Element extends UnistParent {
/**
* Information associated with the element.
*/
attributes?: Attributes;
attributes?: Attributes | undefined;
children: Array<ElementChildMap[keyof ElementChildMap]>;
}

Expand Down Expand Up @@ -129,11 +129,11 @@ export interface Doctype extends UnistNode {
/**
* The document’s public identifier.
*/
public?: string;
public?: string | undefined;
/**
* The document’s system identifier.
*/
system?: string;
system?: string | undefined;
}

/**
Expand Down
20 changes: 10 additions & 10 deletions types/xdate/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@

interface formatters_info
{
i?: string;
u?: string;
xxx? : string;
vvv?: (xdate : XDate , useutc : boolean ) => string;
i?: string | undefined;
u?: string | undefined;
xxx? : string | undefined;
vvv?: ((xdate : XDate , useutc : boolean ) => string) | undefined;
}

interface locale_detail
{
monthNames? : string [];
monthNamesShort?: string [];
dayNames?: string[];
dayNamesShort?: string [];
amDesignator?: string;
pmDesignator?: string;
monthNames? : string [] | undefined;
monthNamesShort?: string [] | undefined;
dayNames?: string[] | undefined;
dayNamesShort?: string [] | undefined;
amDesignator?: string | undefined;
pmDesignator?: string | undefined;
}


Expand Down
14 changes: 7 additions & 7 deletions types/xelib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,23 +304,23 @@ export interface GetREFRsOptions {
* Pass true to exclude deleted REFRs.
* @default false
*/
excludeDeleted?: boolean;
excludeDeleted?: boolean | undefined;
/**
* Pass true to exclude disabled REFRs.
* @default false
*/
excludeDisabled?: boolean;
excludeDisabled?: boolean | undefined;
/**
* Pass true to exclude REFRs which have an XESP element.
* @default false
*/
excludeXESP?: boolean;
excludeXESP?: boolean | undefined;
}

export interface Vector {
X?: number;
Y?: number;
Z?: number;
X?: number | undefined;
Y?: number | undefined;
Z?: number | undefined;
}

/**
Expand Down Expand Up @@ -1573,7 +1573,7 @@ export interface XELib
/**
* @see CreateHandleGroup
*/
HandleGroup?: Handle[];
HandleGroup?: Handle[] | undefined;
/**
* Releases all handles in `xelib.HandleGroup`.
* After calling this, handles retrieved from xelib
Expand Down
4 changes: 2 additions & 2 deletions types/xml-c14n/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ declare namespace xml_c14n {
type canonicaliseCb = (err: any, data: string) => void;

interface Options {
includeComments?: boolean;
inclusiveNamespaces?: boolean;
includeComments?: boolean | undefined;
inclusiveNamespaces?: boolean | undefined;
}

interface Canonicalize {
Expand Down
28 changes: 14 additions & 14 deletions types/xml-crypto/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ export class HashAlgorithm {

export interface Reference {
xpath: string;
transforms?: ReadonlyArray<string>;
digestAlgorithm?: string;
uri?: string;
digestValue?: string;
inclusiveNamespacesPrefixList?: string;
isEmptyUri?: boolean;
transforms?: ReadonlyArray<string> | undefined;
digestAlgorithm?: string | undefined;
uri?: string | undefined;
digestValue?: string | undefined;
inclusiveNamespacesPrefixList?: string | undefined;
isEmptyUri?: boolean | undefined;
}

export class SignatureAlgorithm {
Expand All @@ -44,10 +44,10 @@ export class SignedXml {
signingKey: Buffer | string;
validationErrors: string[];
constructor(idMode?: string | null, options?: {
canonicalizationAlgorithm?: string
idAttribute?: string
implicitTransforms?: ReadonlyArray<string>
signatureAlgorithm?: string
canonicalizationAlgorithm?: string | undefined
idAttribute?: string | undefined
implicitTransforms?: ReadonlyArray<string> | undefined
signatureAlgorithm?: string | undefined
})
addReference(
xpath: string,
Expand All @@ -62,13 +62,13 @@ export class SignedXml {
computeSignature(
xml: string,
opts?: {
prefix?: string,
attrs?: {[key: string]: any},
prefix?: string | undefined,
attrs?: {[key: string]: any} | undefined,
location?: {
reference: string,
action: 'append' | 'prepend' | 'before' | 'after'
},
existingPrefixes?: {[prefix: string]: string}
} | undefined,
existingPrefixes?: {[prefix: string]: string} | undefined
}
): void;
getOriginalXmlWithIds(): string;
Expand Down
10 changes: 5 additions & 5 deletions types/xml-encryption/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ export type EncryptionAlgorithm =

export interface EncryptOptions extends EncryptKeyOptions {
encryptionAlgorithm: EncryptionAlgorithm;
warnInsecureAlgorithm?: boolean;
input_encoding?: Utf8AsciiBinaryEncoding;
warnInsecureAlgorithm?: boolean | undefined;
input_encoding?: Utf8AsciiBinaryEncoding | undefined;
}

export interface EncryptKeyOptions {
rsa_pub: string | Buffer;
pem: string | Buffer;
keyEncryptionAlgorithm: KeyEncryptionAlgorithm;
disallowEncryptionWithInsecureAlgorithm?: boolean;
disallowEncryptionWithInsecureAlgorithm?: boolean | undefined;
}

export interface DecryptOptions {
key: string | Buffer;
disallowDecryptionWithInsecureAlgorithm?: boolean;
warnInsecureAlgorithm?: boolean;
disallowDecryptionWithInsecureAlgorithm?: boolean | undefined;
warnInsecureAlgorithm?: boolean | undefined;
}

export function decrypt(
Expand Down
22 changes: 11 additions & 11 deletions types/xml-flow/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ declare namespace flow {
const ALWAYS = 1;

interface parserOptions {
preserveMarkup?: typeof NEVER | typeof SOMETIMES | typeof ALWAYS;
simplifyNodes?: boolean;
useArrays?: typeof NEVER | typeof SOMETIMES | typeof ALWAYS;
lowercase?: boolean;
trim?: boolean;
normalize?: boolean;
cdataAsText?: boolean;
strict?: boolean;
preserveMarkup?: typeof NEVER | typeof SOMETIMES | typeof ALWAYS | undefined;
simplifyNodes?: boolean | undefined;
useArrays?: typeof NEVER | typeof SOMETIMES | typeof ALWAYS | undefined;
lowercase?: boolean | undefined;
trim?: boolean | undefined;
normalize?: boolean | undefined;
cdataAsText?: boolean | undefined;
strict?: boolean | undefined;
}
interface toXmlOptions {
indent?: string;
selfClosing?: boolean;
escape?: (s: string) => string;
indent?: string | undefined;
selfClosing?: boolean | undefined;
escape?: ((s: string) => string) | undefined;
}
function toXml(obj: object, options?: toXmlOptions): string;
}
Expand Down
2 changes: 1 addition & 1 deletion types/xml-parser/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ declare namespace parse {
name: string;
attributes: Attributes;
children: Node[];
content?: string;
content?: string | undefined;
}

export interface Attributes {
Expand Down
6 changes: 3 additions & 3 deletions types/xml-zero-lexer/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ declare namespace Lexx {
/**
* @default ["script", "style"]
*/
blackholes?: string[];
blackholes?: string[] | undefined;
/**
* @default false
*/
jsx?: boolean;
jsx?: boolean | undefined;
/**
* @default false
*/
html?: boolean;
html?: boolean | undefined;
}

/**
Expand Down
12 changes: 6 additions & 6 deletions types/xml/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ declare namespace xml {
/**
* String used for tab, defaults to no tabs (compressed)
*/
indent?: string;
indent?: string | undefined;
/**
* Return the result as a `stream` (default false)
*/
stream?: boolean;
stream?: boolean | undefined;
/**
* Add default xml declaration (default false)
*/
declaration?:
| boolean
| {
encoding?: string;
standalone?: string;
};
encoding?: string | undefined;
standalone?: string | undefined;
} | undefined;
}

interface XmlAttrs {
Expand Down Expand Up @@ -53,7 +53,7 @@ declare namespace xml {

declare function xml(
xmlObject: xml.XmlObject | xml.XmlObject[],
options: { stream: true; indent?: string },
options: { stream: true; indent?: string | undefined },
): NodeJS.ReadableStream;
declare function xml(xmlObject?: xml.XmlObject | xml.XmlObject[], options?: boolean | string | xml.Option): string;

Expand Down
Loading

0 comments on commit a46c575

Please sign in to comment.