From 870d0a198692c65d2857765d1b216738ec74856f Mon Sep 17 00:00:00 2001 From: Sergei Butko Date: Sat, 22 Feb 2020 21:40:44 +0200 Subject: [PATCH 1/2] Convert ShortLinkType to enum from interface This was probably a mistake but at this very moment this part of the code makes no sense as interface and logically should be presented as enum. --- packages/dynamic-links/lib/index.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/dynamic-links/lib/index.d.ts b/packages/dynamic-links/lib/index.d.ts index 306ba4dd..70fc0aa4 100644 --- a/packages/dynamic-links/lib/index.d.ts +++ b/packages/dynamic-links/lib/index.d.ts @@ -371,28 +371,28 @@ export namespace FirebaseDynamicLinksTypes { * const link = await firebase.dynamicLinks().buildShortLink({ * link: 'https://invertase.io', * domainUriPrefix: 'https://xyz.page.link', - * }, firebase.dynamicLinks.ShortLinkType.UNGUESSABLE); + * }, FirebaseDynamicLinksTypes.ShortLinkType.UNGUESSABLE); * ``` */ - export interface ShortLinkType { + export enum ShortLinkType { /** * Shorten the path to a string that is only as long as needed to be unique, with a minimum length * of 4 characters. Use this if sensitive information would not be exposed if a short * Dynamic Link URL were guessed. */ - SHORT: 'SHORT'; + SHORT = 'SHORT', /** * Shorten the path to an unguessable string. Such strings are created by base62-encoding randomly * generated 96-bit numbers, and consist of 17 alphanumeric characters. Use unguessable strings * to prevent your Dynamic DynamicLinks from being crawled, which can potentially expose sensitive information. */ - UNGUESSABLE: 'UNGUESSABLE'; + UNGUESSABLE = 'UNGUESSABLE', /** * By default, Firebase returns a standard formatted link. */ - DEFAULT: 'DEFAULT'; + DEFAULT = 'DEFAULT', } /** From 48a8670b0766b10e37ea24474b21887abd93bd9f Mon Sep 17 00:00:00 2001 From: svbutko Date: Thu, 27 Feb 2020 21:37:13 +0200 Subject: [PATCH 2/2] Change the statics type of ShortLinkType --- packages/dynamic-links/lib/index.d.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/dynamic-links/lib/index.d.ts b/packages/dynamic-links/lib/index.d.ts index 70fc0aa4..ac279d3a 100644 --- a/packages/dynamic-links/lib/index.d.ts +++ b/packages/dynamic-links/lib/index.d.ts @@ -381,14 +381,12 @@ export namespace FirebaseDynamicLinksTypes { * Dynamic Link URL were guessed. */ SHORT = 'SHORT', - /** * Shorten the path to an unguessable string. Such strings are created by base62-encoding randomly * generated 96-bit numbers, and consist of 17 alphanumeric characters. Use unguessable strings * to prevent your Dynamic DynamicLinks from being crawled, which can potentially expose sensitive information. */ UNGUESSABLE = 'UNGUESSABLE', - /** * By default, Firebase returns a standard formatted link. */ @@ -430,9 +428,9 @@ export namespace FirebaseDynamicLinksTypes { */ export interface Statics { /** - * Returns the {@link links.ShortLinkType} interface. + * Returns the {@link links.ShortLinkType} enum. */ - ShortLinkType: ShortLinkType; + ShortLinkType: typeof ShortLinkType; } /**