diff --git a/types/apollo-upload-client/index.d.ts b/types/apollo-upload-client/index.d.ts index c6476f2ae9..b219b84510 100644 --- a/types/apollo-upload-client/index.d.ts +++ b/types/apollo-upload-client/index.d.ts @@ -2,13 +2,19 @@ // Project: https://github.com/jaydenseric/apollo-upload-client#readme // Definitions by: Edward Sammut Alessi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 3.1 import { ApolloLink } from "apollo-link"; import { HttpOptions } from "apollo-link-http-common"; export { ReactNativeFile } from "extract-files"; +declare global { + interface GlobalFetch { + fetch: WindowOrWorkerGlobalScope["fetch"]; + } +} + /** * `createUploadLink` options match `createHttpLink` options * @param linkOptions `HttpOptions` diff --git a/types/dom-inputevent/index.d.ts b/types/dom-inputevent/index.d.ts index 2b55f1d0a7..8188936f99 100644 --- a/types/dom-inputevent/index.d.ts +++ b/types/dom-inputevent/index.d.ts @@ -4,14 +4,16 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped interface InputEventInit extends UIEventInit { - data?: string; - isComposing: boolean; + data?: string | null; + isComposing?: boolean; } // tslint:disable-next-line no-empty-interface -interface InputEvent extends UIEvent {} -declare class InputEvent { - constructor(typeArg: 'input' | 'beforeinput', inputEventInit?: InputEventInit); - readonly data: string; +interface InputEvent extends UIEvent { + readonly data: string | null; readonly isComposing: boolean; } +declare var InputEvent: { + prototype: InputEvent; + new(type: string, eventInitDict?: InputEventInit): InputEvent; +}; diff --git a/types/to-markdown/to-markdown-tests.ts b/types/to-markdown/to-markdown-tests.ts index f50f348bc8..44e764513d 100644 --- a/types/to-markdown/to-markdown-tests.ts +++ b/types/to-markdown/to-markdown-tests.ts @@ -34,7 +34,7 @@ toMarkdown(` { filter(node) { return node.nodeName === 'SPAN' - && /italic/i.test(node.style.fontStyle!); + && /italic/i.test(node.style.fontStyle || ""); }, replacement(innerHTML) { return `*${innerHTML}*`; @@ -43,7 +43,7 @@ toMarkdown(` { filter(node) { return node.nodeName === 'SPAN' - && /italic/i.test(node.style.fontStyle!); + && /italic/i.test(node.style.fontStyle || ""); }, replacement(innerHTML, node) { return `${innerHTML}(node: \`${node.nodeName}\`)`; diff --git a/types/webappsec-credential-management/index.d.ts b/types/webappsec-credential-management/index.d.ts index 7fc8c73d37..b2bc6bc006 100644 --- a/types/webappsec-credential-management/index.d.ts +++ b/types/webappsec-credential-management/index.d.ts @@ -57,7 +57,7 @@ interface CMRequestInit { * interface. */ interface Navigator { - credentials?: CredentialsContainer; + readonly credentials: CredentialsContainer; } /** @@ -73,7 +73,7 @@ interface CredentialsContainer { * return. * @see {@link https://www.w3.org/TR/credential-management-1/#dom-credentialscontainer-get} */ - get(options?: CredentialRequestOptions): Promise; + get(options?: CredentialRequestOptions): Promise; /** * Ask the credential manager to store a {@link Credential} for the user. @@ -82,14 +82,14 @@ interface CredentialsContainer { * * @see {@link https://www.w3.org/TR/credential-management-1/#dom-credentialscontainer-store} */ - store(credential: Credential): Promise; + store(credential: CredentialType): Promise; /** * Create a {@link Credential} asynchronously. * * @see {@link https://www.w3.org/TR/2017/WD-credential-management-1-20170804/#dom-credentialscontainer-create} */ - create(options: CredentialCreationOptions): Promise; + create(options: CredentialCreationOptions): Promise; /** * Ask the credential manager to require user mediation before returning @@ -126,7 +126,7 @@ interface CredentialData { id: string; } -type Credential = PasswordCredential|FederatedCredential|PublicKeyCredential; +type CredentialType = PasswordCredential|FederatedCredential|PublicKeyCredential; /** * A generic and extensible Credential interface from which all credentials @@ -279,11 +279,6 @@ declare class FederatedCredential extends SiteBoundCredential { readonly protocol: string|null; } -/** - * @see {@link https://www.w3.org/TR/2017/WD-credential-management-1-20170804/#enumdef-credentialmediationrequirement} - */ -type CredentialMediationRequirement = 'silent'|'optional'|'required'; - /** * @see {@link https://www.w3.org/TR/credential-management-1/#dictdef-credentialrequestoptions} */ @@ -312,7 +307,7 @@ interface CredentialRequestOptions { * This property specifies the mediation requirements for a given credential * request. */ - mediation?: CredentialMediationRequirement; + mediation?: 'silent' | 'optional' | 'required'; /** * This property specifies options for requesting a public-key signature. diff --git a/types/webappsec-credential-management/webappsec-credential-management-tests.ts b/types/webappsec-credential-management/webappsec-credential-management-tests.ts index e9d8540e4f..ade1ecfa71 100644 --- a/types/webappsec-credential-management/webappsec-credential-management-tests.ts +++ b/types/webappsec-credential-management/webappsec-credential-management-tests.ts @@ -164,7 +164,7 @@ function passwordPostSignInConfirmation() { const c = new PasswordCredential(formElem); fetch(formElem.action, { method: 'POST', credentials: c }).then(r => { if (r.status === 200) { - navigator.credentials!.store(c); + navigator.credentials.store(c); } }); }