UNPKG

@omnia/fx

Version:

Provide Omnia Fx typings and tooling for clientside Omnia development.

43 lines (42 loc) 1.4 kB
import { VNodeDirective } from "vue"; import { LinkType, LinkTypeConfig } from "@omnia/fx-models"; /** * Link handler options */ export interface LinkHandlerOptions { /** * URL passed to link handler provider */ url: string; /** * Link type to match with provider */ linkType: LinkType; /** * Additional configuration for link handler and provider */ config?: LinkTypeConfig; } export declare function registerLinkHandlerDirective(): void; /** * Create a vue directive handling link redirection on mobile browsers (e.g. open new tab or open with application) * @description * WARNING: When using this function, be sure to remove all `onClick` props event, or else the `onClick` event will be fired along with directive handler function * * @example * // Using provided cdirective construction function * <a {...LinkHandlerDirective( * { * url: "https://google.com/testttt", * linkType: new DefaultLinkType(), * config: { fallback: () => {}, openNewWindow:false * }})}>Test strong Type</a> * // Using inline * <a v-omfx-link-handler={{ url, linkType, config }}>Inline test</a> * * @param options Link handler options * @returns {Array[VNodeDirective]} Array contains link handler directive */ export declare function LinkHandlerDirective(options: LinkHandlerOptions): { directives: VNodeDirective[]; };