nuxt-content-assets 1.8.1 → 1.8.3

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.
package/dist/module.d.mts CHANGED
@@ -1,3 +1,46 @@
1
+ interface ModuleOptions {
2
+ /**
3
+ * Image size hints
4
+ *
5
+ * @example 'attrs style url'
6
+ * @default 'style'
7
+ */
8
+ imageSize?: string | string[] | false;
9
+ /**
10
+ * List of content extensions; anything else as an asset
11
+ *
12
+ * @example 'md'
13
+ * @default 'md csv ya?ml json'
14
+ */
15
+ contentExtensions?: string | string[];
16
+ /**
17
+ * Display debug messages
18
+ *
19
+ * @example true
20
+ * @default false
21
+ */
22
+ debug?: boolean;
23
+ }
24
+ type ImageSize = Array<'style' | 'src' | 'url' | 'attrs'>;
25
+ type AssetConfig = {
26
+ srcAttr: string;
27
+ content: string[];
28
+ width?: number;
29
+ height?: number;
30
+ };
31
+ interface AssetMessage {
32
+ event: 'update' | 'remove' | 'refresh';
33
+ src?: string;
34
+ width?: string;
35
+ height?: string;
36
+ }
37
+ type Callback = (data: any) => void;
38
+ interface SocketInstance {
39
+ send: (data: any) => SocketInstance;
40
+ addHandler: (handler: Callback) => SocketInstance;
41
+ }
42
+
1
43
  declare const _default: any;
2
44
 
3
45
  export { _default as default };
46
+ export type { AssetConfig, AssetMessage, ImageSize, ModuleOptions, SocketInstance };
@@ -0,0 +1,46 @@
1
+ interface ModuleOptions {
2
+ /**
3
+ * Image size hints
4
+ *
5
+ * @example 'attrs style url'
6
+ * @default 'style'
7
+ */
8
+ imageSize?: string | string[] | false;
9
+ /**
10
+ * List of content extensions; anything else as an asset
11
+ *
12
+ * @example 'md'
13
+ * @default 'md csv ya?ml json'
14
+ */
15
+ contentExtensions?: string | string[];
16
+ /**
17
+ * Display debug messages
18
+ *
19
+ * @example true
20
+ * @default false
21
+ */
22
+ debug?: boolean;
23
+ }
24
+ type ImageSize = Array<'style' | 'src' | 'url' | 'attrs'>;
25
+ type AssetConfig = {
26
+ srcAttr: string;
27
+ content: string[];
28
+ width?: number;
29
+ height?: number;
30
+ };
31
+ interface AssetMessage {
32
+ event: 'update' | 'remove' | 'refresh';
33
+ src?: string;
34
+ width?: string;
35
+ height?: string;
36
+ }
37
+ type Callback = (data: any) => void;
38
+ interface SocketInstance {
39
+ send: (data: any) => SocketInstance;
40
+ addHandler: (handler: Callback) => SocketInstance;
41
+ }
42
+
43
+ declare const _default: any;
44
+
45
+ export { _default as default };
46
+ export type { AssetConfig, AssetMessage, ImageSize, ModuleOptions, SocketInstance };
package/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.0.0"
6
6
  },
7
- "version": "1.8.1",
7
+ "version": "1.8.3",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
@@ -20,7 +20,7 @@ const plugin = async (nitro) => {
20
20
  const { tag, props } = node;
21
21
  for (const [prop, value] of Object.entries(props)) {
22
22
  if (typeof value !== "string") {
23
- return;
23
+ continue;
24
24
  }
25
25
  const { srcAttr, width, height } = resolveAsset(content, value, true);
26
26
  if (srcAttr) {
package/dist/types.d.mts CHANGED
@@ -1,7 +1,3 @@
1
- import type { NuxtModule } from '@nuxt/schema'
2
-
3
- import type { default as Module } from './module.mjs'
4
-
5
- export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
6
-
7
1
  export { default } from './module.mjs'
2
+
3
+ export { type AssetConfig, type AssetMessage, type ImageSize, type ModuleOptions, type SocketInstance } from './module.mjs'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-content-assets",
3
- "version": "1.8.1",
3
+ "version": "1.8.3",
4
4
  "description": "Enable locally-located assets in Nuxt Content",
5
5
  "repository": {
6
6
  "type": "git",
@@ -10,7 +10,7 @@
10
10
  "type": "module",
11
11
  "exports": {
12
12
  ".": {
13
- "types": "./dist/types.d.mts",
13
+ "types": "./dist/module.d.ts",
14
14
  "import": "./dist/module.mjs"
15
15
  }
16
16
  },