Skip to content

Latest commit

 

History

History
283 lines (161 loc) · 8.22 KB

TYPINGS.md

File metadata and controls

283 lines (161 loc) · 8.22 KB

hyperlink-middleware (show presentation)

Table of contents

Classes

Interfaces

Type Aliases

Functions

Type Aliases

DynamicLinkParam

Ƭ DynamicLinkParam: "apn" | "afl" | "amv" | "ibi" | "ifl" | "ius" | "ipfl" | "ipbi" | "isi" | "imv" | "efr" | "ofl" | "st" | "sd" | "si" | "utm_source" | "utm_medium" | "utm_campaign" | "utm_term" | "utm_content" | "at" | "ct" | "mt" | "pt" | "d"

Ref: https://firebase.google.com/docs/dynamic-links/create-manually

Defined in

middlewares/format-firebase-dynamic-links.ts:15


FilterWrapperOptions

Ƭ FilterWrapperOptions: FilterPatterns

Defined in

wrappers/filter.ts:8


IgnoreFollowingsOptions

Ƭ IgnoreFollowingsOptions: FilterPatterns

Defined in

middlewares/ignore-followings.ts:4


Middleware

Ƭ Middleware: (properties: HyperlinkProperties, element: Node | null, next: MiddlewareNext) => void

Type declaration

▸ (properties, element, next): void

Parameters
Name Type
properties HyperlinkProperties
element Node | null
next MiddlewareNext
Returns

void

Defined in

middleware.ts:9


MiddlewareNext

Ƭ MiddlewareNext: (properties?: HyperlinkProperties) => void

Type declaration

▸ (properties?): void

Middleware interface to respect to chain middleware in a composition

Parameters
Name Type
properties? HyperlinkProperties
Returns

void

Defined in

middleware.ts:8


UtmParam

Ƭ UtmParam: UtmParamEnum.Source | UtmParamEnum.Medium | UtmParamEnum.Campaign | UtmParamEnum.Content | UtmParamEnum.Name | UtmParamEnum.Term | UtmParamEnum.InitialSource | UtmParamEnum.InitialMedium | UtmParamEnum.InitialCampaign | UtmParamEnum.InitialContent | UtmParamEnum.InitialName | UtmParamEnum.InitialTerm

Defined in

middlewares/set-utm-parameters.ts:18

Functions

FilterWrapper

FilterWrapper(middleware, options): Middleware

The wrapper to filter middlewares helps applying or not the passed middleware depending on the hyperlink matching the conditions

Parameters

Name Type
middleware Middleware
options FilterPatterns

Returns

Middleware

Defined in

wrappers/filter.ts:41


FormatFirebaseDynamicLinksMiddleware

FormatFirebaseDynamicLinksMiddleware(options): Middleware

UTM middleware to inject predefined parameters into links depending on options

Parameters

Name Type
options FormatFirebaseDynamicLinksOptions

Returns

Middleware

Defined in

middlewares/format-firebase-dynamic-links.ts:62


IgnoreFollowingsMiddleware

IgnoreFollowingsMiddleware(options?): Middleware

Depending on parameters rules will not call the following chained middlewares

Parameters

Name Type
options? FilterPatterns

Returns

Middleware

Defined in

middlewares/ignore-followings.ts:7


SetMissingUrlProtocolMiddleware

SetMissingUrlProtocolMiddleware(options?): Middleware

If the hyperlink URL starts with // (like //example.com) it means the browser will in all case try to use the current protocol.

This middleware adds the protocol to the URL to facilicate the next middlewares that in majority use new URL() that would fail without a protocol

Reminder: it's not advised to use this because if the HTML file is saved locally and open with the file:// protocol, the link would not work

Parameters

Name Type
options? SetMissingUrlProtocolOptions

Returns

Middleware

Defined in

middlewares/set-missing-url-protocol.ts:13


SetUtmParametersMiddleware

SetUtmParametersMiddleware(options): Middleware

UTM middleware to inject predefined parameters into links depending on options

Parameters

Name Type
options SetUtmParametersOptions

Returns

Middleware

Defined in

middlewares/set-utm-parameters.ts:38


getDefaultHyperlinkWatcherOptions

getDefaultHyperlinkWatcherOptions(): HyperlinkWatcherOptions

Returns

HyperlinkWatcherOptions

Defined in

watcher.ts:15


isHyperlinkAllowed

isHyperlinkAllowed(href, filters): boolean

Helper to let it pass or not depending on the hyperlink input

Parameters

Name Type
href string
filters FilterPatterns

Returns

boolean

Defined in

wrappers/filter.ts:11