type ScriptStrategy = 'server' | 'client' | 'idle' | 'worker'; type ScriptLocation = 'head' | 'body'; type ScriptAction = 'append' | 'prepend'; type SrcVal = { url: string; slugParam?: string; params?: Array; }; type AttributeVal = string | null | SrcVal | boolean | undefined; type HtmlAttributes = { src?: SrcVal; [key: string]: AttributeVal; }; type ScriptBase = { params?: Array; optionalParams?: Record; strategy: ScriptStrategy; location: ScriptLocation; action: ScriptAction; key?: string; }; type ExternalScript = ScriptBase & { url: string; }; type CodeBlock = ScriptBase & { code: string; }; type Script = ExternalScript | CodeBlock; type Scripts = Script[]; interface Data { id: string; description: string; website?: string; html?: { element: string; attributes: HtmlAttributes; }; stylesheets?: Array; scripts?: Scripts; } interface Inputs { [key: string]: any; } interface Output { id: string; description: string; website?: string; html?: string; stylesheets?: Array; scripts?: Scripts; } interface GoogleAnalyticsParams { id: string; /** * The name of the dataLayer object. Defaults to 'dataLayer'. */ l?: string; /** * Consent type for Google Analytics. * @default 'default' */ consentType?: string; /** * Consent values for Google Analytics. */ consentValues?: { [key: string]: string; }; } interface GTag { (fn: 'js', opt: Date): void; (fn: 'config', opt: string): void; (fn: 'event', opt: string, opt2?: { [key: string]: any; }): void; (fn: 'set', opt: { [key: string]: string; }): void; (fn: 'get', opt: string): void; (fn: 'consent', opt: 'default', opt2: { [key: string]: string; }): void; (fn: 'consent', opt: 'update', opt2: { [key: string]: string; }): void; (fn: 'config', opt: 'reset'): void; } type DataLayer = Array | Record>; interface GoogleTagManagerParams { id: string; /** * The name of the dataLayer object. Defaults to 'dataLayer'. */ l?: string; /** * Consent type for Google Tag Manager. * @default 'default' */ consentType?: string; /** * Consent values for Google Tag Manager. */ consentValues?: { [key: string]: string; }; } interface GoogleTagManagerDataLayerApi { name: 'dataLayer'; set: (opt: { [key: string]: string; }) => void; get: (key: string) => void; reset: () => void; } type GoogleTagManagerDataLayerStatus = { dataLayer: { gtmDom: boolean; gtmLoad: boolean; subscribers: number; }; }; type GoogleTagManagerInstance = GoogleTagManagerDataLayerStatus & { [key: string]: { callback: () => void; dataLayer: GoogleTagManagerDataLayerApi; }; }; interface GoogleTagManagerApi { google_tag_manager: GoogleTagManagerInstance; } interface GoogleMapsEmbedParams { key: string; mode: 'place' | 'view' | 'directions' | 'streetview' | 'search'; q?: string; center?: string; zoom?: string; maptype?: 'roadmap' | 'satellite'; language?: string; region?: string; } interface YoutubeEmbedAttributes { videoid: string; playlabel?: string; } declare function isExternalScript(script: Script): script is ExternalScript; declare const GoogleAnalytics: ({ ...args }: Inputs) => Output; declare const GoogleTagManager: ({ ...args }: Inputs) => Output; declare const GoogleMapsEmbed: ({ ...args }: Inputs) => Output; declare const YouTubeEmbed: ({ ...args }: Inputs) => Output; declare function formatUrl(url: string, params?: string[], args?: Inputs, slug?: Inputs, optionalParams?: Inputs): string; declare function formatCode(code: string, args?: Inputs, optionalParams?: Inputs): string; declare function createHtml(element: string, attributes?: HtmlAttributes, htmlAttrArgs?: Inputs, urlQueryParamArgs?: Inputs, slugParamArg?: Inputs): string; declare function formatData(data: Data, args: Inputs): Output; const id$3 = "google-analytics"; const description$3 = "Install a Google Analytics tag on your website"; const website$3 = "https://analytics.google.com/analytics/web/"; const scripts$2 = [ { url: "https://www.googletagmanager.com/gtag/js", params: [ "id" ], optionalParams: { l: null }, strategy: "worker", location: "head", action: "append", key: "gtag" }, { code: "window[{{l}}]=window[{{l}}]||[];window['gtag-'+{{l}}]=function (){window[{{l}}].push(arguments);};{{#consentValues}}window['gtag-'+{{l}}]('consent', {{consentType}}, {{consentValues}});{{/consentValues}}window['gtag-'+{{l}}]('js',new Date());window['gtag-'+{{l}}]('config',{{id}})", params: [ "id" ], optionalParams: { l: "dataLayer", consentType: "default", consentValues: null }, strategy: "worker", location: "head", action: "append", key: "setup" } ]; var googleAnalytics = { id: id$3, description: description$3, website: website$3, scripts: scripts$2 }; const id$2 = "google-tag-manager"; const description$2 = "Install Google Tag Manager on your website"; const website$2 = "https://developers.google.com/tag-platform/tag-manager/web"; const scripts$1 = [ { url: "https://www.googletagmanager.com/gtm.js", params: [ "id" ], optionalParams: { l: null }, strategy: "worker", location: "head", action: "append", key: "gtm" }, { code: "window[{{l}}]=window[{{l}}]||[];{{#consentValues}}(function () {window[{{l}}].push(arguments)})('consent', {{consentType}}, {{consentValues}});{{/consentValues}}window[{{l}}].push({'gtm.start':new Date().getTime(),event:'gtm.js'});", optionalParams: { l: "dataLayer", consentType: "default", consentValues: null }, strategy: "worker", location: "head", action: "append", key: "setup" } ]; var googleTagManager = { id: id$2, description: description$2, website: website$2, scripts: scripts$1 }; const id$1 = "google-maps-embed"; const description$1 = "Embed a Google Maps embed on your webpage"; const website$1 = "https://developers.google.com/maps/documentation/embed/get-started"; const html$1 = { element: "iframe", attributes: { loading: "lazy", src: { url: "https://www.google.com/maps/embed/v1/place", slugParam: "mode", params: [ "key", "q", "center", "zoom", "maptype", "language", "region" ] }, referrerpolicy: "no-referrer-when-downgrade", frameborder: "0", style: "border:0", allowfullscreen: true, width: null, height: null } }; var googleMapsEmbed = { id: id$1, description: description$1, website: website$1, html: html$1 }; const id = "youtube-embed"; const description = "Embed a YouTube embed on your webpage."; const website = "https://github.com/paulirish/lite-youtube-embed"; const html = { element: "lite-youtube", attributes: { videoid: null, playlabel: null } }; const stylesheets = [ "https://cdn.jsdelivr.net/gh/paulirish/lite-youtube-embed@master/src/lite-yt-embed.css" ]; const scripts = [ { url: "https://cdn.jsdelivr.net/gh/paulirish/lite-youtube-embed@master/src/lite-yt-embed.js", strategy: "idle", location: "head", action: "append", key: "lite-yt-embed" } ]; var youtubeEmbed = { id: id, description: description, website: website, html: html, stylesheets: stylesheets, scripts: scripts }; export { type AttributeVal, type CodeBlock, type Data, type DataLayer, type ExternalScript, type GTag, googleAnalytics as GooglaAnalyticsData, GoogleAnalytics, type GoogleAnalyticsParams, GoogleMapsEmbed, googleMapsEmbed as GoogleMapsEmbedData, type GoogleMapsEmbedParams, GoogleTagManager, type GoogleTagManagerApi, googleTagManager as GoogleTagManagerData, type GoogleTagManagerInstance, type GoogleTagManagerParams, youtubeEmbed as GoogleYoutubeEmbedData, type HtmlAttributes, type Inputs, type Output, type Script, type Scripts, type SrcVal, YouTubeEmbed, type YoutubeEmbedAttributes, createHtml, formatCode, formatData, formatUrl, isExternalScript };