@kong/kongponents 9.43.3-pr.2953.77fdad2.0 → 9.43.3-pr.2953.d3d2c2f.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 (2) hide show
  1. package/dist/nuxt/index.js +11 -1
  2. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { defineNuxtModule, createResolver, addComponent, useLogger, addImportsDir } from '@nuxt/kit';
1
+ import { defineNuxtModule, createResolver, addComponent, useLogger, addImportsDir, addTypeTemplate } from '@nuxt/kit';
2
2
  import { components } from '@kong/kongponents';
3
3
  // Components that should always be excluded from auto-registration
4
4
  const ALWAYS_EXCLUDE_COMPONENTS = ['ToastManager', 'KTable', 'KModalFullscreen', 'KDropdownMenu'];
@@ -22,6 +22,16 @@ export default defineNuxtModule({
22
22
  if (options.composables) {
23
23
  // Register composables
24
24
  addImportsDir(resolve('./runtime/composables'));
25
+ // we need explicitly provide and register type declarations for module-injected composables
26
+ addTypeTemplate({
27
+ filename: 'types/use-toast.d.ts',
28
+ getContents: () => `
29
+ import type { Toast } from '@kong/kongponents'
30
+ declare module '#imports' {
31
+ export function useToast(): { showToast(notification: Partial<Toast>): Promise<void> }
32
+ }
33
+ `,
34
+ });
25
35
  }
26
36
  // Define a list of components that should be auto-registered.
27
37
  const includeList = options.components?.include || [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kong/kongponents",
3
- "version": "9.43.3-pr.2953.77fdad2.0",
3
+ "version": "9.43.3-pr.2953.d3d2c2f.0",
4
4
  "description": "Kong Component library",
5
5
  "type": "module",
6
6
  "repository": {