@nuxt/scripts 0.3.9 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/client/200.html +5 -5
  2. package/dist/client/404.html +5 -5
  3. package/dist/client/_nuxt/{BRKoJ6lw.js → C7Ygk604.js} +1 -1
  4. package/dist/client/_nuxt/{Df--iwTR.js → CCsrmkFc.js} +1 -1
  5. package/dist/client/_nuxt/{Dmsejhs1.js → CFYSkdJN.js} +1 -1
  6. package/dist/client/_nuxt/{BwVNWVdS.js → DbUJKcwL.js} +3 -3
  7. package/dist/client/_nuxt/builds/latest.json +1 -1
  8. package/dist/client/_nuxt/builds/meta/2a8bbe8d-00a2-43ea-ae62-2d603f7034d4.json +1 -0
  9. package/dist/client/index.html +5 -5
  10. package/dist/module.json +1 -1
  11. package/dist/runtime/composables/useAnalyticsPageEvent.d.ts +1 -4
  12. package/dist/runtime/registry/cloudflare-web-analytics.d.ts +2 -19
  13. package/dist/runtime/registry/fathom-analytics.d.ts +2 -31
  14. package/dist/runtime/registry/google-analytics.d.ts +2 -11
  15. package/dist/runtime/registry/google-maps.d.ts +2 -12
  16. package/dist/runtime/registry/google-tag-manager.d.ts +2 -8
  17. package/dist/runtime/registry/hotjar.d.ts +2 -10
  18. package/dist/runtime/registry/intercom.d.ts +2 -22
  19. package/dist/runtime/registry/lemon-squeezy.d.ts +1 -3
  20. package/dist/runtime/registry/matomo-analytics.d.ts +2 -14
  21. package/dist/runtime/registry/meta-pixel.d.ts +2 -8
  22. package/dist/runtime/registry/npm.d.ts +2 -14
  23. package/dist/runtime/registry/plausible-analytics.d.ts +2 -10
  24. package/dist/runtime/registry/segment.d.ts +2 -10
  25. package/dist/runtime/registry/stripe.d.ts +2 -8
  26. package/dist/runtime/registry/vimeo-player.d.ts +1 -3
  27. package/dist/runtime/registry/x-pixel.d.ts +2 -10
  28. package/dist/runtime/registry/x-pixel.mjs +1 -1
  29. package/dist/runtime/registry/youtube-player.d.ts +1 -3
  30. package/dist/runtime/utils.d.ts +2 -4
  31. package/package.json +3 -3
  32. package/dist/client/_nuxt/builds/meta/42eedd27-01ea-43c5-acca-daf3456cac3d.json +0 -1
@@ -1 +1 @@
1
- {"id":"42eedd27-01ea-43c5-acca-daf3456cac3d","timestamp":1715047560600}
1
+ {"id":"2a8bbe8d-00a2-43ea-ae62-2d603f7034d4","timestamp":1715052970628}
@@ -0,0 +1 @@
1
+ {"id":"2a8bbe8d-00a2-43ea-ae62-2d603f7034d4","timestamp":1715052970628,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
@@ -1,7 +1,7 @@
1
1
  <!DOCTYPE html><html><head><meta charset="utf-8">
2
2
  <meta name="viewport" content="width=device-width, initial-scale=1">
3
3
  <link rel="stylesheet" href="/__nuxt-scripts/_nuxt/entry.D91GVkD7.css">
4
- <link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BwVNWVdS.js">
4
+ <link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DbUJKcwL.js">
5
5
  <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DXFkqnOI.js">
6
6
  <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/D6NljDpC.js">
7
7
  <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/CowR2XfX.js">
@@ -239,10 +239,10 @@
239
239
  <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/V_y36BGi.js">
240
240
  <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BGq4KZyx.js">
241
241
  <link rel="prefetch" as="style" href="/__nuxt-scripts/_nuxt/error-404.BRldFSII.css">
242
- <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/Dmsejhs1.js">
243
- <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/Df--iwTR.js">
242
+ <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/CFYSkdJN.js">
243
+ <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/CCsrmkFc.js">
244
244
  <link rel="prefetch" as="style" href="/__nuxt-scripts/_nuxt/error-500.D8yw_IbC.css">
245
- <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BRKoJ6lw.js">
246
- <script type="module" src="/__nuxt-scripts/_nuxt/BwVNWVdS.js" crossorigin></script><script>"use strict";(()=>{const a=window,e=document.documentElement,c=window.localStorage,d=["dark","light"],n=c&&c.getItem&&c.getItem("nuxt-color-mode")||"system";let l=n==="system"?f():n;const i=e.getAttribute("data-color-mode-forced");i&&(l=i),r(l),a["__NUXT_COLOR_MODE__"]={preference:n,value:l,getColorScheme:f,addColorScheme:r,removeColorScheme:u};function r(o){const t=""+o+"",s="";e.classList?e.classList.add(t):e.className+=" "+t,s&&e.setAttribute("data-"+s,o)}function u(o){const t=""+o+"",s="";e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp(t,"g"),""),s&&e.removeAttribute("data-"+s)}function m(o){return a.matchMedia("(prefers-color-scheme"+o+")")}function f(){if(a.matchMedia&&m("").media!=="not all"){for(const o of d)if(m(":"+o).matches)return o}return"light"}})();
245
+ <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/C7Ygk604.js">
246
+ <script type="module" src="/__nuxt-scripts/_nuxt/DbUJKcwL.js" crossorigin></script><script>"use strict";(()=>{const a=window,e=document.documentElement,c=window.localStorage,d=["dark","light"],n=c&&c.getItem&&c.getItem("nuxt-color-mode")||"system";let l=n==="system"?f():n;const i=e.getAttribute("data-color-mode-forced");i&&(l=i),r(l),a["__NUXT_COLOR_MODE__"]={preference:n,value:l,getColorScheme:f,addColorScheme:r,removeColorScheme:u};function r(o){const t=""+o+"",s="";e.classList?e.classList.add(t):e.className+=" "+t,s&&e.setAttribute("data-"+s,o)}function u(o){const t=""+o+"",s="";e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp(t,"g"),""),s&&e.removeAttribute("data-"+s)}function m(o){return a.matchMedia("(prefers-color-scheme"+o+")")}function f(){if(a.matchMedia&&m("").media!=="not all"){for(const o of d)if(m(":"+o).matches)return o}return"light"}})();
247
247
  </script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"_errors":1,"serverRendered":2,"data":3,"state":4,"once":5},{},false,{},{},["Set"]]</script>
248
248
  <script>window.__NUXT__={};window.__NUXT__.config={public:{"nuxt-scripts":{defaultScriptOptions:{trigger:"onNuxtReady"}}},app:{baseURL:"/__nuxt-scripts",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
package/dist/module.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "nuxt": ">=3",
6
6
  "bridge": false
7
7
  },
8
- "version": "0.3.9",
8
+ "version": "0.4.0",
9
9
  "builder": {
10
10
  "@nuxt/module-builder": "0.6.0",
11
11
  "unbuild": "2.0.0"
@@ -1,5 +1,2 @@
1
1
  import type { TrackedPage } from '#nuxt-scripts';
2
- export declare function useAnalyticsPageEvent(onChange?: (payload: TrackedPage) => void): import("#imports").Ref<{
3
- title?: string | undefined;
4
- path: string;
5
- }>;
2
+ export declare function useAnalyticsPageEvent(onChange?: (payload: TrackedPage) => void): import("#imports").Ref<any>;
@@ -16,23 +16,6 @@ declare global {
16
16
  interface Window extends CloudflareWebAnalyticsApi {
17
17
  }
18
18
  }
19
- export declare const CloudflareWebAnalyticsOptions: import("valibot").ObjectSchema<{
20
- /**
21
- * The Cloudflare Web Analytics token.
22
- */
23
- token: import("valibot").StringSchema<string>;
24
- /**
25
- * Cloudflare Web Analytics enables measuring SPAs automatically by overriding the History API’s pushState function
26
- * and listening to the onpopstate. Hash-based router is not supported.
27
- *
28
- * @default true
29
- */
30
- spa: import("valibot").OptionalSchema<import("valibot").BooleanSchema<boolean>, undefined, boolean | undefined>;
31
- }, undefined, {
32
- token: string;
33
- spa?: boolean | undefined;
34
- }>;
19
+ export declare const CloudflareWebAnalyticsOptions: any;
35
20
  export type CloudflareWebAnalyticsInput = RegistryScriptInput<typeof CloudflareWebAnalyticsOptions>;
36
- export declare function useScriptCloudflareWebAnalytics<T extends CloudflareWebAnalyticsApi>(_options?: CloudflareWebAnalyticsInput): T & {
37
- $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
38
- };
21
+ export declare function useScriptCloudflareWebAnalytics<T extends CloudflareWebAnalyticsApi>(_options?: CloudflareWebAnalyticsInput): any;
@@ -1,32 +1,5 @@
1
1
  import type { RegistryScriptInput } from '#nuxt-scripts';
2
- export declare const FathomAnalyticsOptions: import("valibot").ObjectSchema<{
3
- /**
4
- * The Fathom Analytics site ID.
5
- */
6
- site: import("valibot").StringSchema<string>;
7
- /**
8
- * The Fathom Analytics tracking mode.
9
- */
10
- spa: import("valibot").OptionalSchema<import("valibot").UnionSchema<(import("valibot").LiteralSchema<"auto", "auto"> | import("valibot").LiteralSchema<"history", "history"> | import("valibot").LiteralSchema<"hash", "hash">)[], "auto" | "history" | "hash">, undefined, "auto" | "history" | "hash" | undefined>;
11
- /**
12
- * Automatically track page views.
13
- */
14
- auto: import("valibot").OptionalSchema<import("valibot").BooleanSchema<boolean>, undefined, boolean | undefined>;
15
- /**
16
- * Enable canonical URL tracking.
17
- */
18
- canonical: import("valibot").OptionalSchema<import("valibot").BooleanSchema<boolean>, undefined, boolean | undefined>;
19
- /**
20
- * Honor Do Not Track requests.
21
- */
22
- honorDnt: import("valibot").OptionalSchema<import("valibot").BooleanSchema<boolean>, undefined, boolean | undefined>;
23
- }, undefined, {
24
- site: string;
25
- auto?: boolean | undefined;
26
- spa?: "auto" | "history" | "hash" | undefined;
27
- canonical?: boolean | undefined;
28
- honorDnt?: boolean | undefined;
29
- }>;
2
+ export declare const FathomAnalyticsOptions: any;
30
3
  export type FathomAnalyticsInput = RegistryScriptInput<typeof FathomAnalyticsOptions, false>;
31
4
  export interface FathomAnalyticsApi {
32
5
  beacon: (ctx: {
@@ -53,6 +26,4 @@ declare global {
53
26
  fathom: FathomAnalyticsApi;
54
27
  }
55
28
  }
56
- export declare function useScriptFathomAnalytics<T extends FathomAnalyticsApi>(_options?: FathomAnalyticsInput): T & {
57
- $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
58
- };
29
+ export declare function useScriptFathomAnalytics<T extends FathomAnalyticsApi>(_options?: FathomAnalyticsInput): any;
@@ -1,13 +1,6 @@
1
1
  import type { GoogleAnalyticsApi } from 'third-party-capital';
2
2
  import type { RegistryScriptInput } from '#nuxt-scripts';
3
- export declare const GoogleAnalyticsOptions: import("valibot").ObjectSchema<{
4
- /**
5
- * The Google Analytics ID.
6
- */
7
- id: import("valibot").StringSchema<string>;
8
- }, undefined, {
9
- id: string;
10
- }>;
3
+ export declare const GoogleAnalyticsOptions: any;
11
4
  export type GoogleAnalyticsInput = RegistryScriptInput<typeof GoogleAnalyticsOptions>;
12
5
  declare global {
13
6
  interface Window extends GoogleAnalyticsApi {
@@ -18,6 +11,4 @@ declare global {
18
11
  *
19
12
  * A 3P wrapper for Google Analytics that takes an options input to feed into third-party-capital({@link https://github.com/GoogleChromeLabs/third-party-capital}), which returns instructions for nuxt-scripts.
20
13
  */
21
- export declare function useScriptGoogleAnalytics<T extends GoogleAnalyticsApi>(_options?: GoogleAnalyticsInput): T & {
22
- $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
23
- };
14
+ export declare function useScriptGoogleAnalytics<T extends GoogleAnalyticsApi>(_options?: GoogleAnalyticsInput): any;
@@ -1,13 +1,5 @@
1
1
  import type { RegistryScriptInput } from '#nuxt-scripts';
2
- export declare const GoogleMapsOptions: import("valibot").ObjectSchema<{
3
- apiKey: import("valibot").StringSchema<string>;
4
- libraries: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").StringSchema<string>, string[]>, undefined, string[] | undefined>;
5
- v: import("valibot").OptionalSchema<import("valibot").UnionSchema<(import("valibot").LiteralSchema<"weekly", "weekly"> | import("valibot").LiteralSchema<"beta", "beta"> | import("valibot").LiteralSchema<"alpha", "alpha">)[], "weekly" | "beta" | "alpha">, undefined, "weekly" | "beta" | "alpha" | undefined>;
6
- }, undefined, {
7
- apiKey: string;
8
- libraries?: string[] | undefined;
9
- v?: "weekly" | "beta" | "alpha" | undefined;
10
- }>;
2
+ export declare const GoogleMapsOptions: any;
11
3
  export type GoogleMapsInput = RegistryScriptInput<typeof GoogleMapsOptions>;
12
4
  declare namespace google.maps {
13
5
  /**
@@ -23,7 +15,5 @@ declare global {
23
15
  google: typeof google;
24
16
  }
25
17
  }
26
- export declare function useScriptGoogleMaps<T extends GoogleMapsApi>(_options?: GoogleMapsInput): T & {
27
- $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
28
- };
18
+ export declare function useScriptGoogleMaps<T extends GoogleMapsApi>(_options?: GoogleMapsInput): any;
29
19
  export {};
@@ -1,10 +1,6 @@
1
1
  import type { GoogleTagManagerApi } from 'third-party-capital';
2
2
  import type { RegistryScriptInput } from '#nuxt-scripts';
3
- declare const GoogleTagManagerOptions: import("valibot").ObjectSchema<{
4
- id: import("valibot").StringSchema<string>;
5
- }, undefined, {
6
- id: string;
7
- }>;
3
+ declare const GoogleTagManagerOptions: any;
8
4
  export type GoogleTagManagerInput = RegistryScriptInput<typeof GoogleTagManagerOptions>;
9
5
  declare global {
10
6
  interface Window extends GoogleTagManagerApi {
@@ -15,7 +11,5 @@ declare global {
15
11
  *
16
12
  * A 3P wrapper for Google Tag Manager that takes an options input to feed into third-party-capital({@link https://github.com/GoogleChromeLabs/third-party-capital}), which returns instructions for nuxt-scripts.
17
13
  */
18
- export declare function useScriptGoogleTagManager<T extends GoogleTagManagerApi>(options?: GoogleTagManagerInput): T & {
19
- $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
20
- };
14
+ export declare function useScriptGoogleTagManager<T extends GoogleTagManagerApi>(options?: GoogleTagManagerInput): any;
21
15
  export {};
@@ -12,14 +12,6 @@ declare global {
12
12
  };
13
13
  }
14
14
  }
15
- export declare const HotjarOptions: import("valibot").ObjectSchema<{
16
- id: import("valibot").NumberSchema<number>;
17
- sv: import("valibot").OptionalSchema<import("valibot").NumberSchema<number>, undefined, number | undefined>;
18
- }, undefined, {
19
- id: number;
20
- sv?: number | undefined;
21
- }>;
15
+ export declare const HotjarOptions: any;
22
16
  export type HotjarInput = RegistryScriptInput<typeof HotjarOptions>;
23
- export declare function useScriptHotjar<T extends HotjarApi>(_options?: HotjarInput): T & {
24
- $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
25
- };
17
+ export declare function useScriptHotjar<T extends HotjarApi>(_options?: HotjarInput): any;
@@ -1,24 +1,6 @@
1
1
  import { type Input } from '#nuxt-scripts-validator';
2
2
  import type { RegistryScriptInput } from '#nuxt-scripts';
3
- export declare const IntercomOptions: import("valibot").ObjectSchema<{
4
- app_id: import("valibot").StringSchema<string>;
5
- api_base: import("valibot").OptionalSchema<import("valibot").UnionSchema<(import("valibot").LiteralSchema<"https://api-iam.intercom.io", "https://api-iam.intercom.io"> | import("valibot").LiteralSchema<"https://api-iam.eu.intercom.io", "https://api-iam.eu.intercom.io"> | import("valibot").LiteralSchema<"https://api-iam.au.intercom.io", "https://api-iam.au.intercom.io">)[], "https://api-iam.intercom.io" | "https://api-iam.eu.intercom.io" | "https://api-iam.au.intercom.io">, undefined, "https://api-iam.intercom.io" | "https://api-iam.eu.intercom.io" | "https://api-iam.au.intercom.io" | undefined>;
6
- name: import("valibot").OptionalSchema<import("valibot").StringSchema<string>, undefined, string | undefined>;
7
- email: import("valibot").OptionalSchema<import("valibot").StringSchema<string>, undefined, string | undefined>;
8
- user_id: import("valibot").OptionalSchema<import("valibot").StringSchema<string>, undefined, string | undefined>;
9
- alignment: import("valibot").OptionalSchema<import("valibot").UnionSchema<(import("valibot").LiteralSchema<"left", "left"> | import("valibot").LiteralSchema<"right", "right">)[], "left" | "right">, undefined, "left" | "right" | undefined>;
10
- horizontal_padding: import("valibot").OptionalSchema<import("valibot").NumberSchema<number>, undefined, number | undefined>;
11
- vertical_padding: import("valibot").OptionalSchema<import("valibot").NumberSchema<number>, undefined, number | undefined>;
12
- }, undefined, {
13
- app_id: string;
14
- name?: string | undefined;
15
- api_base?: "https://api-iam.intercom.io" | "https://api-iam.eu.intercom.io" | "https://api-iam.au.intercom.io" | undefined;
16
- email?: string | undefined;
17
- user_id?: string | undefined;
18
- alignment?: "left" | "right" | undefined;
19
- horizontal_padding?: number | undefined;
20
- vertical_padding?: number | undefined;
21
- }>;
3
+ export declare const IntercomOptions: any;
22
4
  export type IntercomInput = RegistryScriptInput<typeof IntercomOptions>;
23
5
  export interface IntercomApi {
24
6
  Intercom: ((event: 'boot', data?: Input<typeof IntercomOptions>) => void) & ((event: 'shutdown') => void) & ((event: 'update', options?: Input<typeof IntercomOptions>) => void) & ((event: 'hide') => void) & ((event: 'show') => void) & ((event: 'showSpace', spaceName: 'home' | 'messages' | 'help' | 'news' | 'tasks' | 'tickets' | string) => void) & ((event: 'showMessages') => void) & ((event: 'showNewMessage', content?: string) => void) & ((event: 'onHide', fn: () => void) => void) & ((event: 'onShow', fn: () => void) => void) & ((event: 'onUnreadCountChange', fn: () => void) => void) & ((event: 'trackEvent', eventName: string, metadata?: Record<string, any>) => void) & ((event: 'getVisitorId') => Promise<string>) & ((event: 'startTour', tourId: string | number) => void) & ((event: 'showArticle', articleId: string | number) => void) & ((event: 'showNews', newsItemId: string | number) => void) & ((event: 'startSurvey', surveyId: string | number) => void) & ((event: 'startChecklist', checklistId: string | number) => void) & ((event: 'showTicket', ticketId: string | number) => void) & ((event: 'showConversation', conversationId: string | number) => void) & ((event: 'onUserEmailSupplied', fn: () => void) => void) & ((event: string, ...params: any[]) => void);
@@ -28,6 +10,4 @@ declare global {
28
10
  intercomSettings?: IntercomInput;
29
11
  }
30
12
  }
31
- export declare function useScriptIntercom<T extends IntercomApi>(_options?: IntercomInput): T & {
32
- $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
33
- };
13
+ export declare function useScriptIntercom<T extends IntercomApi>(_options?: IntercomInput): any;
@@ -62,6 +62,4 @@ declare global {
62
62
  LemonSqueezy: LemonSqueezyApi;
63
63
  }
64
64
  }
65
- export declare function useScriptLemonSqueezy<T extends LemonSqueezyApi>(_options?: LemonSqueezyInput): T & {
66
- $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
67
- };
65
+ export declare function useScriptLemonSqueezy<T extends LemonSqueezyApi>(_options?: LemonSqueezyInput): any;
@@ -1,15 +1,5 @@
1
1
  import type { RegistryScriptInput } from '#nuxt-scripts';
2
- export declare const MatomoAnalyticsOptions: import("valibot").ObjectSchema<{
3
- matomoUrl: import("valibot").StringSchema<string>;
4
- siteId: import("valibot").StringSchema<string>;
5
- trackPageView: import("valibot").OptionalSchema<import("valibot").BooleanSchema<boolean>, undefined, boolean | undefined>;
6
- enableLinkTracking: import("valibot").OptionalSchema<import("valibot").BooleanSchema<boolean>, undefined, boolean | undefined>;
7
- }, undefined, {
8
- matomoUrl: string;
9
- siteId: string;
10
- trackPageView?: boolean | undefined;
11
- enableLinkTracking?: boolean | undefined;
12
- }>;
2
+ export declare const MatomoAnalyticsOptions: any;
13
3
  export type MatomoAnalyticsInput = RegistryScriptInput<typeof MatomoAnalyticsOptions, false>;
14
4
  interface MatomoAnalyticsApi {
15
5
  _paq: unknown[];
@@ -18,7 +8,5 @@ declare global {
18
8
  interface Window extends MatomoAnalyticsApi {
19
9
  }
20
10
  }
21
- export declare function useScriptMatomoAnalytics<T extends MatomoAnalyticsApi>(_options?: MatomoAnalyticsInput): T & {
22
- $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
23
- };
11
+ export declare function useScriptMatomoAnalytics<T extends MatomoAnalyticsApi>(_options?: MatomoAnalyticsInput): any;
24
12
  export {};
@@ -32,13 +32,7 @@ declare global {
32
32
  interface Window extends MetaPixelApi {
33
33
  }
34
34
  }
35
- export declare const MetaPixelOptions: import("valibot").ObjectSchema<{
36
- id: import("valibot").UnionSchema<(import("valibot").StringSchema<string> | import("valibot").NumberSchema<number>)[], string | number>;
37
- }, undefined, {
38
- id: string | number;
39
- }>;
35
+ export declare const MetaPixelOptions: any;
40
36
  export type MetaPixelInput = RegistryScriptInput<typeof MetaPixelOptions>;
41
- export declare function useScriptMetaPixel<T extends MetaPixelApi>(_options?: MetaPixelInput): T & {
42
- $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
43
- };
37
+ export declare function useScriptMetaPixel<T extends MetaPixelApi>(_options?: MetaPixelInput): any;
44
38
  export {};
@@ -1,16 +1,4 @@
1
1
  import type { RegistryScriptInput } from '#nuxt-scripts';
2
- export declare const NpmOptions: import("valibot").ObjectSchema<{
3
- packageName: import("valibot").StringSchema<string>;
4
- file: import("valibot").OptionalSchema<import("valibot").StringSchema<string>, undefined, string | undefined>;
5
- version: import("valibot").OptionalSchema<import("valibot").StringSchema<string>, undefined, string | undefined>;
6
- type: import("valibot").OptionalSchema<import("valibot").StringSchema<string>, undefined, string | undefined>;
7
- }, undefined, {
8
- packageName: string;
9
- type?: string | undefined;
10
- file?: string | undefined;
11
- version?: string | undefined;
12
- }>;
2
+ export declare const NpmOptions: any;
13
3
  export type NpmInput = RegistryScriptInput<typeof NpmOptions>;
14
- export declare function useScriptNpm<T extends Record<string | symbol, any>>(_options: NpmInput): T & {
15
- $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
16
- };
4
+ export declare function useScriptNpm<T extends Record<string | symbol, any>>(_options: NpmInput): any;
@@ -1,11 +1,5 @@
1
1
  import type { RegistryScriptInput } from '#nuxt-scripts';
2
- export declare const PlausibleAnalyticsOptions: import("valibot").ObjectSchema<{
3
- domain: import("valibot").StringSchema<string>;
4
- extension: import("valibot").OptionalSchema<import("valibot").UnionSchema<(import("valibot").UnionSchema<(import("valibot").LiteralSchema<"hash", "hash"> | import("valibot").LiteralSchema<"outbound-links", "outbound-links"> | import("valibot").LiteralSchema<"file-downloads", "file-downloads"> | import("valibot").LiteralSchema<"tagged-events", "tagged-events"> | import("valibot").LiteralSchema<"revenue", "revenue"> | import("valibot").LiteralSchema<"pageview-props", "pageview-props"> | import("valibot").LiteralSchema<"compat", "compat"> | import("valibot").LiteralSchema<"local", "local"> | import("valibot").LiteralSchema<"manual", "manual">)[], "manual" | "hash" | "outbound-links" | "file-downloads" | "tagged-events" | "revenue" | "pageview-props" | "compat" | "local"> | import("valibot").ArraySchema<import("valibot").UnionSchema<(import("valibot").LiteralSchema<"hash", "hash"> | import("valibot").LiteralSchema<"outbound-links", "outbound-links"> | import("valibot").LiteralSchema<"file-downloads", "file-downloads"> | import("valibot").LiteralSchema<"tagged-events", "tagged-events"> | import("valibot").LiteralSchema<"revenue", "revenue"> | import("valibot").LiteralSchema<"pageview-props", "pageview-props"> | import("valibot").LiteralSchema<"compat", "compat"> | import("valibot").LiteralSchema<"local", "local"> | import("valibot").LiteralSchema<"manual", "manual">)[], "manual" | "hash" | "outbound-links" | "file-downloads" | "tagged-events" | "revenue" | "pageview-props" | "compat" | "local">, ("manual" | "hash" | "outbound-links" | "file-downloads" | "tagged-events" | "revenue" | "pageview-props" | "compat" | "local")[]>)[], "manual" | "hash" | "outbound-links" | "file-downloads" | "tagged-events" | "revenue" | "pageview-props" | "compat" | "local" | ("manual" | "hash" | "outbound-links" | "file-downloads" | "tagged-events" | "revenue" | "pageview-props" | "compat" | "local")[]>, undefined, "manual" | "hash" | "outbound-links" | "file-downloads" | "tagged-events" | "revenue" | "pageview-props" | "compat" | "local" | ("manual" | "hash" | "outbound-links" | "file-downloads" | "tagged-events" | "revenue" | "pageview-props" | "compat" | "local")[] | undefined>;
5
- }, undefined, {
6
- domain: string;
7
- extension?: "manual" | "hash" | "outbound-links" | "file-downloads" | "tagged-events" | "revenue" | "pageview-props" | "compat" | "local" | ("manual" | "hash" | "outbound-links" | "file-downloads" | "tagged-events" | "revenue" | "pageview-props" | "compat" | "local")[] | undefined;
8
- }>;
2
+ export declare const PlausibleAnalyticsOptions: any;
9
3
  export type PlausibleAnalyticsInput = RegistryScriptInput<typeof PlausibleAnalyticsOptions, false>;
10
4
  export interface PlausibleAnalyticsApi {
11
5
  plausible: ((event: '404', options: Record<string, any>) => void) & ((event: 'event', options: Record<string, any>) => void) & ((...params: any[]) => void) & {
@@ -17,6 +11,4 @@ declare global {
17
11
  plausible: PlausibleAnalyticsApi;
18
12
  }
19
13
  }
20
- export declare function useScriptPlausibleAnalytics<T extends PlausibleAnalyticsApi>(_options?: PlausibleAnalyticsInput): T & {
21
- $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
22
- };
14
+ export declare function useScriptPlausibleAnalytics<T extends PlausibleAnalyticsApi>(_options?: PlausibleAnalyticsInput): any;
@@ -1,11 +1,5 @@
1
1
  import type { RegistryScriptInput } from '#nuxt-scripts';
2
- export declare const SegmentOptions: import("valibot").ObjectSchema<{
3
- writeKey: import("valibot").StringSchema<string>;
4
- analyticsKey: import("valibot").OptionalSchema<import("valibot").StringSchema<string>, undefined, string | undefined>;
5
- }, undefined, {
6
- writeKey: string;
7
- analyticsKey?: string | undefined;
8
- }>;
2
+ export declare const SegmentOptions: any;
9
3
  export type SegmentInput = RegistryScriptInput<typeof SegmentOptions>;
10
4
  interface AnalyticsApi {
11
5
  track: (event: string, properties?: Record<string, any>) => void;
@@ -33,7 +27,5 @@ declare global {
33
27
  interface Window extends SegmentApi {
34
28
  }
35
29
  }
36
- export declare function useScriptSegment<T extends SegmentApi>(_options?: SegmentInput): T & {
37
- $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
38
- };
30
+ export declare function useScriptSegment<T extends SegmentApi>(_options?: SegmentInput): any;
39
31
  export {};
@@ -1,10 +1,6 @@
1
1
  /// <reference types="stripe-v3" />
2
2
  import type { RegistryScriptInput } from '#nuxt-scripts';
3
- export declare const StripeOptions: import("valibot").ObjectSchema<{
4
- advancedFraudSignals: import("valibot").OptionalSchema<import("valibot").BooleanSchema<boolean>, undefined, boolean | undefined>;
5
- }, undefined, {
6
- advancedFraudSignals?: boolean | undefined;
7
- }>;
3
+ export declare const StripeOptions: any;
8
4
  export type StripeInput = RegistryScriptInput<typeof StripeOptions, false>;
9
5
  export interface StripeApi {
10
6
  Stripe: stripe.StripeStatic;
@@ -13,6 +9,4 @@ declare global {
13
9
  interface Window extends StripeApi {
14
10
  }
15
11
  }
16
- export declare function useScriptStripe<T extends StripeApi>(_options?: StripeInput): T & {
17
- $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
18
- };
12
+ export declare function useScriptStripe<T extends StripeApi>(_options?: StripeInput): any;
@@ -10,6 +10,4 @@ declare global {
10
10
  interface Window extends VimeoPlayerApi {
11
11
  }
12
12
  }
13
- export declare function useScriptVimeoPlayer<T extends VimeoPlayerApi>(_options?: VimeoPlayerInput): T & {
14
- $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
15
- };
13
+ export declare function useScriptVimeoPlayer<T extends VimeoPlayerApi>(_options?: VimeoPlayerInput): any;
@@ -27,15 +27,7 @@ declare global {
27
27
  interface Window extends XPixelApi {
28
28
  }
29
29
  }
30
- export declare const XPixelOptions: import("valibot").ObjectSchema<{
31
- id: import("valibot").StringSchema<string>;
32
- version: import("valibot").OptionalSchema<import("valibot").StringSchema<string>, undefined, string | undefined>;
33
- }, undefined, {
34
- id: string;
35
- version?: string | undefined;
36
- }>;
30
+ export declare const XPixelOptions: any;
37
31
  export type XPixelInput = RegistryScriptInput<typeof XPixelOptions>;
38
- export declare function useScriptXPixel<T extends XPixelApi>(_options?: XPixelInput): T & {
39
- $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
40
- };
32
+ export declare function useScriptXPixel<T extends XPixelApi>(_options?: XPixelInput): any;
41
33
  export {};
@@ -7,9 +7,9 @@ export const XPixelOptions = object({
7
7
  export function useScriptXPixel(_options) {
8
8
  return useRegistryScript("xPixel", (options) => {
9
9
  return {
10
+ // @ts-expect-error TODO fix upstream
10
11
  scriptInput: {
11
12
  src: "https://static.ads-twitter.com/uwt.js",
12
- // @ts-expect-error TODO fix upstream
13
13
  crossorigin: false
14
14
  },
15
15
  clientInit: import.meta.server ? void 0 : () => {
@@ -9,6 +9,4 @@ declare global {
9
9
  }
10
10
  }
11
11
  export type YouTubePlayerInput = RegistryScriptInput;
12
- export declare function useScriptYouTubePlayer<T extends YouTubePlayerApi>(_options: YouTubePlayerInput): T & {
13
- $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
14
- };
12
+ export declare function useScriptYouTubePlayer<T extends YouTubePlayerApi>(_options: YouTubePlayerInput): any;
@@ -7,8 +7,6 @@ type OptionsFn<O extends ObjectSchema<any>> = (options: Input<O>) => ({
7
7
  schema?: O;
8
8
  clientInit?: () => void;
9
9
  });
10
- export declare function scriptRuntimeConfig<T extends keyof ScriptRegistry>(key: T): ScriptRegistry[T];
11
- export declare function useRegistryScript<T extends Record<string | symbol, any>, O extends ObjectSchema<any> = EmptyOptionsSchema>(key: keyof ScriptRegistry | string, optionsFn: OptionsFn<O>, _userOptions?: RegistryScriptInput<O>): T & {
12
- $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
13
- };
10
+ export declare function scriptRuntimeConfig<T extends keyof ScriptRegistry>(key: T): ScriptRegistry;
11
+ export declare function useRegistryScript<T extends Record<string | symbol, any>, O extends ObjectSchema<any> = EmptyOptionsSchema>(key: keyof ScriptRegistry | string, optionsFn: OptionsFn<O>, _userOptions?: RegistryScriptInput<O>): any;
14
12
  export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nuxt/scripts",
3
3
  "type": "module",
4
- "version": "0.3.9",
4
+ "version": "0.4.0",
5
5
  "description": "Load third-party scripts with better performance, privacy and DX in Nuxt Apps.",
6
6
  "author": {
7
7
  "website": "https://harlanzw.com",
@@ -104,7 +104,7 @@
104
104
  "release": "pnpm build && bumpp && pnpm publish --no-git-checks",
105
105
  "lint": "eslint .",
106
106
  "lint:fix": "eslint . --fix",
107
- "test": "true",
108
- "test:types": "true"
107
+ "test": "vitest",
108
+ "test:types": "tsc --noEmit"
109
109
  }
110
110
  }
@@ -1 +0,0 @@
1
- {"id":"42eedd27-01ea-43c5-acca-daf3456cac3d","timestamp":1715047560600,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}