diff options
author | Matthew Miller <matthew@millerti.me> | 2023-08-18 13:59:11 -0700 |
---|---|---|
committer | Matthew Miller <matthew@millerti.me> | 2023-08-18 13:59:11 -0700 |
commit | a59634a1a9b0393622fb121fbe229132c01a2624 (patch) | |
tree | cb4eb3fdf778dfc88d6d389b609b1cef6ebb4b4d /packages/typescript-types | |
parent | e0d32bd2a3a60b4b2fd96a2874eae3ad976483df (diff) |
Use single-quotes and increase line width
Diffstat (limited to 'packages/typescript-types')
-rw-r--r-- | packages/typescript-types/build_npm.ts | 7 | ||||
-rw-r--r-- | packages/typescript-types/extract-dom-types.ts | 42 | ||||
-rw-r--r-- | packages/typescript-types/src/index.ts | 25 |
3 files changed, 37 insertions, 37 deletions
diff --git a/packages/typescript-types/build_npm.ts b/packages/typescript-types/build_npm.ts index 765e3ec..6837aa2 100644 --- a/packages/typescript-types/build_npm.ts +++ b/packages/typescript-types/build_npm.ts @@ -1,7 +1,9 @@ import { build, emptyDir } from 'https://deno.land/x/dnt@0.38.0/mod.ts'; const outDir = './npm'; -const lernaPackageJSON: { version: string } = JSON.parse(await Deno.readTextFile('./package.json')); +const lernaPackageJSON: { version: string } = JSON.parse( + await Deno.readTextFile('./package.json'), +); await emptyDir(outDir); @@ -28,7 +30,8 @@ await build({ url: 'https://github.com/MasterKale/SimpleWebAuthn.git', directory: 'packages/typescript-types', }, - homepage: "https://github.com/MasterKale/SimpleWebAuthn/tree/master/packages/typescript-types#readme", + homepage: + 'https://github.com/MasterKale/SimpleWebAuthn/tree/master/packages/typescript-types#readme', publishConfig: { access: 'public', }, diff --git a/packages/typescript-types/extract-dom-types.ts b/packages/typescript-types/extract-dom-types.ts index a5362f7..436ac5b 100644 --- a/packages/typescript-types/extract-dom-types.ts +++ b/packages/typescript-types/extract-dom-types.ts @@ -16,33 +16,33 @@ import { Structure, SyntaxKind, TypeAliasDeclaration, -} from "ts-morph"; -import { version } from "typescript"; +} from 'ts-morph'; +import { version } from 'typescript'; // List of types we directly reference from the dom lib. Only interface and type // alias identifiers are valid, since other syntax types (class, function, var) // are implementations, which will not be available outside of the browser. const types = [ - "AuthenticatorAssertionResponse", - "AttestationConveyancePreference", - "AuthenticatorAttestationResponse", - "AuthenticatorTransport", - "AuthenticationExtensionsClientInputs", - "AuthenticationExtensionsClientOutputs", - "AuthenticatorSelectionCriteria", - "COSEAlgorithmIdentifier", - "Crypto", - "PublicKeyCredential", - "PublicKeyCredentialCreationOptions", - "PublicKeyCredentialDescriptor", - "PublicKeyCredentialParameters", - "PublicKeyCredentialRequestOptions", - "PublicKeyCredentialUserEntity", - "UserVerificationRequirement", + 'AuthenticatorAssertionResponse', + 'AttestationConveyancePreference', + 'AuthenticatorAttestationResponse', + 'AuthenticatorTransport', + 'AuthenticationExtensionsClientInputs', + 'AuthenticationExtensionsClientOutputs', + 'AuthenticatorSelectionCriteria', + 'COSEAlgorithmIdentifier', + 'Crypto', + 'PublicKeyCredential', + 'PublicKeyCredentialCreationOptions', + 'PublicKeyCredentialDescriptor', + 'PublicKeyCredentialParameters', + 'PublicKeyCredentialRequestOptions', + 'PublicKeyCredentialUserEntity', + 'UserVerificationRequirement', ]; const project = new Project({ skipAddingFilesFromTsConfig: true }); -const domSourcePath = "typescript/lib/lib.dom.d.ts"; +const domSourcePath = 'typescript/lib/lib.dom.d.ts'; const domSourceFile = project.addSourceFileAtPath( require.resolve(domSourcePath), ); @@ -91,9 +91,7 @@ outputSourceFile.addStatements([ `// To regenerate, run the following command from the project root:`, `// npx lerna --scope=@simplewebauthn/typescript-types exec -- npm run extract-dom-types`, ]); -const resolvedStructures = Array.from(resolvedNodes).map((node) => - node.getStructure() -); +const resolvedStructures = Array.from(resolvedNodes).map((node) => node.getStructure()); outputSourceFile.addInterfaces( resolvedStructures.filter(Structure.isInterface), ); diff --git a/packages/typescript-types/src/index.ts b/packages/typescript-types/src/index.ts index 22b2dc4..f06b26d 100644 --- a/packages/typescript-types/src/index.ts +++ b/packages/typescript-types/src/index.ts @@ -20,7 +20,7 @@ import type { PublicKeyCredentialRpEntity, PublicKeyCredentialType, UserVerificationRequirement, -} from "./dom.ts"; +} from './dom.ts'; export type { AttestationConveyancePreference, @@ -42,7 +42,7 @@ export type { PublicKeyCredentialType, PublicKeyCredentialUserEntity, UserVerificationRequirement, -} from "./dom.ts"; +} from './dom.ts'; /** * A variant of PublicKeyCredentialCreationOptions suitable for JSON transmission to the browser to @@ -197,8 +197,7 @@ export type Base64URLString = string; * * Properties marked optional are not supported in all browsers. */ -export interface AuthenticatorAttestationResponseFuture - extends AuthenticatorAttestationResponse { +export interface AuthenticatorAttestationResponseFuture extends AuthenticatorAttestationResponse { getTransports(): AuthenticatorTransportFuture[]; } @@ -208,13 +207,13 @@ export interface AuthenticatorAttestationResponseFuture * know about it (sometime after 4.6.3) */ export type AuthenticatorTransportFuture = - | "ble" - | "cable" - | "hybrid" - | "internal" - | "nfc" - | "smart-card" - | "usb"; + | 'ble' + | 'cable' + | 'hybrid' + | 'internal' + | 'nfc' + | 'smart-card' + | 'usb'; /** * A super class of TypeScript's `PublicKeyCredentialDescriptor` that knows about the latest @@ -222,7 +221,7 @@ export type AuthenticatorTransportFuture = * know about it (sometime after 4.6.3) */ export interface PublicKeyCredentialDescriptorFuture - extends Omit<PublicKeyCredentialDescriptor, "transports"> { + extends Omit<PublicKeyCredentialDescriptor, 'transports'> { transports?: AuthenticatorTransportFuture[]; } @@ -255,4 +254,4 @@ export interface PublicKeyCredentialFuture extends PublicKeyCredential { * - `"singleDevice"` credentials will never be backed up * - `"multiDevice"` credentials can be backed up */ -export type CredentialDeviceType = "singleDevice" | "multiDevice"; +export type CredentialDeviceType = 'singleDevice' | 'multiDevice'; |