@histoire/vendors 1.0.0-alpha.5 → 1.0.0-beta.2

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 (138) hide show
  1. package/build/floating-ui-frames.mjs +28 -0
  2. package/dist/client/b-floating-vue.js +35 -22
  3. package/dist/client/b-vue-router.js +2615 -3624
  4. package/dist/client/b-vue-use.js +87 -77
  5. package/dist/client/b-vue.js +1 -1
  6. package/dist/client/node_modules/@babel/helper-string-parser/package.json +1 -1
  7. package/dist/client/node_modules/@babel/helper-validator-identifier/package.json +1 -1
  8. package/dist/client/node_modules/@babel/parser/package.json +7 -7
  9. package/dist/client/node_modules/@babel/parser/typings/babel-parser.d.ts +24 -26
  10. package/dist/client/node_modules/@babel/types/lib/index-legacy.d.ts +183 -183
  11. package/dist/client/node_modules/@babel/types/lib/index.d.ts +203 -208
  12. package/dist/client/node_modules/@babel/types/package.json +6 -6
  13. package/dist/client/node_modules/@floating-ui/core/dist/floating-ui.core.d.mts +535 -0
  14. package/dist/client/node_modules/@floating-ui/core/dist/floating-ui.core.d.ts +75 -68
  15. package/dist/client/node_modules/@floating-ui/core/package.json +3 -3
  16. package/dist/client/node_modules/@floating-ui/utils/dist/floating-ui.utils.d.mts +105 -0
  17. package/dist/client/node_modules/@floating-ui/utils/dist/floating-ui.utils.d.ts +5 -3
  18. package/dist/client/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.d.mts +47 -0
  19. package/dist/client/node_modules/@floating-ui/utils/package.json +2 -2
  20. package/dist/client/node_modules/@jridgewell/sourcemap-codec/package.json +2 -1
  21. package/dist/client/node_modules/@jridgewell/sourcemap-codec/types/range-mappings.d.mts +5 -0
  22. package/dist/client/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.mts +50 -0
  23. package/dist/client/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts +11 -0
  24. package/dist/client/node_modules/@jridgewell/sourcemap-codec/types/strings.d.mts +16 -0
  25. package/dist/client/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts +9 -0
  26. package/dist/client/node_modules/@types/web-bluetooth/index.d.ts +93 -21
  27. package/dist/client/node_modules/@types/web-bluetooth/package.json +9 -3
  28. package/dist/client/node_modules/@vue/compiler-core/dist/compiler-core.d.ts +20 -11
  29. package/dist/client/node_modules/@vue/compiler-core/package.json +6 -6
  30. package/dist/client/node_modules/@vue/compiler-dom/dist/compiler-dom.d.ts +12 -12
  31. package/dist/client/node_modules/@vue/compiler-dom/package.json +3 -3
  32. package/dist/client/node_modules/@vue/compiler-sfc/dist/compiler-sfc.d.ts +3 -2
  33. package/dist/client/node_modules/@vue/compiler-sfc/package.json +14 -14
  34. package/dist/client/node_modules/@vue/compiler-ssr/package.json +3 -3
  35. package/dist/client/node_modules/@vue/reactivity/dist/reactivity.d.ts +24 -25
  36. package/dist/client/node_modules/@vue/reactivity/package.json +2 -2
  37. package/dist/client/node_modules/@vue/runtime-core/dist/runtime-core.d.ts +48 -41
  38. package/dist/client/node_modules/@vue/runtime-core/package.json +3 -3
  39. package/dist/client/node_modules/@vue/runtime-dom/dist/runtime-dom.d.ts +680 -645
  40. package/dist/client/node_modules/@vue/runtime-dom/package.json +5 -5
  41. package/dist/client/node_modules/@vue/server-renderer/package.json +4 -4
  42. package/dist/client/node_modules/@vue/shared/dist/shared.d.ts +7 -1
  43. package/dist/client/node_modules/@vue/shared/package.json +1 -1
  44. package/dist/client/node_modules/@vueuse/core/index.d.mts +6221 -0
  45. package/dist/client/node_modules/@vueuse/core/index.d.ts +131 -103
  46. package/dist/client/node_modules/@vueuse/core/metadata.d.mts +1 -0
  47. package/dist/client/node_modules/@vueuse/core/package.json +4 -4
  48. package/dist/client/node_modules/@vueuse/metadata/index.d.mts +78 -0
  49. package/dist/client/node_modules/@vueuse/metadata/package.json +1 -1
  50. package/dist/client/node_modules/@vueuse/shared/index.d.mts +1260 -0
  51. package/dist/client/node_modules/@vueuse/shared/index.d.ts +30 -13
  52. package/dist/client/node_modules/@vueuse/shared/package.json +1 -1
  53. package/dist/client/node_modules/csstype/index.d.ts +2326 -782
  54. package/dist/client/node_modules/csstype/package.json +26 -26
  55. package/dist/client/node_modules/entities/decode.d.ts +3 -0
  56. package/dist/client/node_modules/entities/{lib/esm/decode_codepoint.d.ts → dist/commonjs/decode-codepoint.d.ts} +2 -2
  57. package/dist/client/node_modules/entities/{lib → dist/commonjs}/decode.d.ts +20 -26
  58. package/dist/client/node_modules/entities/{lib/esm → dist/commonjs}/encode.d.ts +2 -2
  59. package/dist/client/node_modules/entities/{lib/esm → dist/commonjs}/escape.d.ts +9 -6
  60. package/dist/client/node_modules/entities/dist/commonjs/generated/decode-data-html.d.ts +2 -0
  61. package/dist/client/node_modules/entities/dist/commonjs/generated/decode-data-xml.d.ts +2 -0
  62. package/dist/client/node_modules/entities/dist/commonjs/generated/encode-html.d.ts +3 -0
  63. package/dist/client/node_modules/entities/{lib/esm → dist/commonjs}/index.d.ts +9 -9
  64. package/dist/client/node_modules/entities/dist/commonjs/internal/bin-trie-flags.d.ts +17 -0
  65. package/dist/client/node_modules/entities/dist/commonjs/internal/decode-shared.d.ts +2 -0
  66. package/dist/client/node_modules/entities/dist/commonjs/internal/encode-shared.d.ts +32 -0
  67. package/dist/client/node_modules/entities/dist/commonjs/package.json +3 -0
  68. package/dist/client/node_modules/entities/{lib/decode_codepoint.d.ts → dist/esm/decode-codepoint.d.ts} +2 -2
  69. package/dist/client/node_modules/entities/{lib → dist}/esm/decode.d.ts +20 -26
  70. package/dist/client/node_modules/entities/{lib → dist/esm}/encode.d.ts +2 -2
  71. package/dist/client/node_modules/entities/{lib → dist/esm}/escape.d.ts +9 -6
  72. package/dist/client/node_modules/entities/dist/esm/generated/decode-data-html.d.ts +2 -0
  73. package/dist/client/node_modules/entities/dist/esm/generated/decode-data-xml.d.ts +2 -0
  74. package/dist/client/node_modules/entities/dist/esm/generated/encode-html.d.ts +3 -0
  75. package/dist/client/node_modules/entities/{lib → dist/esm}/index.d.ts +9 -9
  76. package/dist/client/node_modules/entities/dist/esm/internal/bin-trie-flags.d.ts +17 -0
  77. package/dist/client/node_modules/entities/dist/esm/internal/decode-shared.d.ts +2 -0
  78. package/dist/client/node_modules/entities/dist/esm/internal/encode-shared.d.ts +32 -0
  79. package/dist/client/node_modules/entities/dist/esm/package.json +3 -0
  80. package/dist/client/node_modules/entities/escape.d.ts +3 -0
  81. package/dist/client/node_modules/entities/package.json +99 -69
  82. package/dist/client/node_modules/magic-string/dist/magic-string.es.d.mts +289 -0
  83. package/dist/client/node_modules/nanoid/package.json +3 -3
  84. package/dist/client/node_modules/postcss/lib/at-rule.d.ts +0 -1
  85. package/dist/client/node_modules/postcss/lib/comment.d.ts +0 -1
  86. package/dist/client/node_modules/postcss/lib/container.d.ts +17 -26
  87. package/dist/client/node_modules/postcss/lib/css-syntax-error.d.ts +0 -1
  88. package/dist/client/node_modules/postcss/lib/declaration.d.ts +4 -5
  89. package/dist/client/node_modules/postcss/lib/document.d.ts +0 -1
  90. package/dist/client/node_modules/postcss/lib/fromJSON.d.ts +1 -1
  91. package/dist/client/node_modules/postcss/lib/input.d.ts +0 -1
  92. package/dist/client/node_modules/postcss/lib/lazy-result.d.ts +3 -4
  93. package/dist/client/node_modules/postcss/lib/list.d.ts +1 -1
  94. package/dist/client/node_modules/postcss/lib/no-work-result.d.ts +0 -1
  95. package/dist/client/node_modules/postcss/lib/node.d.ts +2 -3
  96. package/dist/client/node_modules/postcss/lib/parse.d.ts +1 -1
  97. package/dist/client/node_modules/postcss/lib/postcss.d.mts +66 -0
  98. package/dist/client/node_modules/postcss/lib/postcss.d.ts +10 -4
  99. package/dist/client/node_modules/postcss/lib/previous-map.d.ts +0 -1
  100. package/dist/client/node_modules/postcss/lib/processor.d.ts +0 -1
  101. package/dist/client/node_modules/postcss/lib/result.d.ts +0 -1
  102. package/dist/client/node_modules/postcss/lib/root.d.ts +0 -1
  103. package/dist/client/node_modules/postcss/lib/rule.d.ts +12 -12
  104. package/dist/client/node_modules/postcss/lib/stringifier.d.ts +0 -1
  105. package/dist/client/node_modules/postcss/lib/stringify.d.ts +1 -1
  106. package/dist/client/node_modules/postcss/lib/warning.d.ts +0 -1
  107. package/dist/client/node_modules/postcss/package.json +45 -45
  108. package/dist/client/node_modules/source-map-js/package.json +14 -7
  109. package/dist/client/node_modules/source-map-js/source-map.d.ts +177 -63
  110. package/dist/client/node_modules/vue/compiler-sfc/index.d.mts +1 -0
  111. package/dist/client/node_modules/vue/dist/vue.d.mts +7 -0
  112. package/dist/client/node_modules/vue/jsx-runtime/index.d.ts +2 -2
  113. package/dist/client/node_modules/vue/jsx.d.ts +1 -1
  114. package/dist/client/node_modules/vue/package.json +6 -6
  115. package/dist/client/node_modules/vue/server-renderer/index.d.mts +1 -0
  116. package/dist/client/node_modules/vue-router/dist/experimental/index.d.mts +38 -0
  117. package/dist/client/node_modules/vue-router/dist/router-CWoNjPRp.d.mts +1973 -0
  118. package/dist/client/node_modules/vue-router/dist/vue-router.d.mts +361 -0
  119. package/dist/client/node_modules/vue-router/package.json +43 -39
  120. package/dist/client/node_modules/vue-router/vue-router-auto-resolver.d.mts +22 -0
  121. package/dist/client/node_modules/vue-router/vue-router-auto.d.ts +1 -4
  122. package/dist/client/vue.runtime.esm-bundler.js +2987 -2699
  123. package/package.json +4 -3
  124. package/rollup.config.mjs +12 -2
  125. package/tsconfig.json +3 -1
  126. package/dist/client/node_modules/entities/lib/esm/generated/decode-data-html.d.ts +0 -3
  127. package/dist/client/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts +0 -3
  128. package/dist/client/node_modules/entities/lib/esm/generated/encode-html.d.ts +0 -8
  129. package/dist/client/node_modules/entities/lib/esm/package.json +0 -1
  130. package/dist/client/node_modules/entities/lib/generated/decode-data-html.d.ts +0 -3
  131. package/dist/client/node_modules/entities/lib/generated/decode-data-xml.d.ts +0 -3
  132. package/dist/client/node_modules/entities/lib/generated/encode-html.d.ts +0 -8
  133. package/dist/client/node_modules/vue-router/dist/vue-router.d.ts +0 -1836
  134. /package/dist/client/node_modules/{pinia/node_modules/vue-demi → vue-demi}/lib/index.d.ts +0 -0
  135. /package/dist/client/node_modules/{pinia/node_modules/vue-demi → vue-demi}/lib/v2/index.d.ts +0 -0
  136. /package/dist/client/node_modules/{pinia/node_modules/vue-demi → vue-demi}/lib/v2.7/index.d.ts +0 -0
  137. /package/dist/client/node_modules/{pinia/node_modules/vue-demi → vue-demi}/lib/v3/index.d.ts +0 -0
  138. /package/dist/client/node_modules/{pinia/node_modules/vue-demi → vue-demi}/package.json +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }
@@ -0,0 +1,3 @@
1
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2
+ // @ts-ignore
3
+ export * from "./dist/commonjs/escape.js";
@@ -1,90 +1,120 @@
1
1
  {
2
2
  "name": "entities",
3
- "version": "4.5.0",
3
+ "version": "7.0.1",
4
4
  "description": "Encode & decode XML and HTML entities with ease & speed",
5
- "author": "Felix Boehm <me@feedic.com>",
6
- "funding": "https://github.com/fb55/entities?sponsor=1",
7
- "sideEffects": false,
8
5
  "keywords": [
9
- "entity",
10
- "decoding",
11
- "encoding",
12
- "html",
13
- "xml",
14
- "html entities"
6
+ "html entities",
7
+ "entity decoder",
8
+ "entity encoding",
9
+ "html decoding",
10
+ "html encoding",
11
+ "xml decoding",
12
+ "xml encoding"
15
13
  ],
16
- "directories": {
17
- "lib": "lib/"
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "https://github.com/fb55/entities.git"
18
17
  },
19
- "main": "lib/index.js",
20
- "types": "lib/index.d.ts",
21
- "module": "lib/esm/index.js",
18
+ "funding": "https://github.com/fb55/entities?sponsor=1",
19
+ "license": "BSD-2-Clause",
20
+ "author": "Felix Boehm <me@feedic.com>",
21
+ "sideEffects": false,
22
+ "type": "module",
22
23
  "exports": {
23
24
  ".": {
24
- "require": "./lib/index.js",
25
- "import": "./lib/esm/index.js"
25
+ "import": {
26
+ "types": "./dist/esm/index.d.ts",
27
+ "default": "./dist/esm/index.js"
28
+ },
29
+ "require": {
30
+ "types": "./dist/commonjs/index.d.ts",
31
+ "default": "./dist/commonjs/index.js"
32
+ }
26
33
  },
27
- "./lib/decode.js": {
28
- "require": "./lib/decode.js",
29
- "import": "./lib/esm/decode.js"
34
+ "./decode": {
35
+ "import": {
36
+ "types": "./dist/esm/decode.d.ts",
37
+ "default": "./dist/esm/decode.js"
38
+ },
39
+ "require": {
40
+ "types": "./dist/commonjs/decode.d.ts",
41
+ "default": "./dist/commonjs/decode.js"
42
+ }
30
43
  },
31
- "./lib/escape.js": {
32
- "require": "./lib/escape.js",
33
- "import": "./lib/esm/escape.js"
44
+ "./escape": {
45
+ "import": {
46
+ "types": "./dist/esm/escape.d.ts",
47
+ "default": "./dist/esm/escape.js"
48
+ },
49
+ "require": {
50
+ "types": "./dist/commonjs/escape.d.ts",
51
+ "default": "./dist/commonjs/escape.js"
52
+ }
34
53
  }
35
54
  },
55
+ "main": "./dist/commonjs/index.js",
56
+ "module": "./dist/esm/index.js",
57
+ "types": "./dist/commonjs/index.d.ts",
36
58
  "files": [
37
- "lib/**/*"
59
+ "decode.js",
60
+ "decode.d.ts",
61
+ "escape.js",
62
+ "escape.d.ts",
63
+ "dist",
64
+ "src",
65
+ "!**/*.spec.ts"
38
66
  ],
39
- "engines": {
40
- "node": ">=0.12"
41
- },
42
- "devDependencies": {
43
- "@types/jest": "^28.1.8",
44
- "@types/node": "^18.15.11",
45
- "@typescript-eslint/eslint-plugin": "^5.58.0",
46
- "@typescript-eslint/parser": "^5.58.0",
47
- "eslint": "^8.38.0",
48
- "eslint-config-prettier": "^8.8.0",
49
- "eslint-plugin-node": "^11.1.0",
50
- "jest": "^28.1.3",
51
- "prettier": "^2.8.7",
52
- "ts-jest": "^28.0.8",
53
- "typedoc": "^0.24.1",
54
- "typescript": "^5.0.4"
55
- },
56
67
  "scripts": {
57
- "test": "npm run test:jest && npm run lint",
58
- "test:jest": "jest",
59
- "lint": "npm run lint:es && npm run lint:prettier",
60
- "lint:es": "eslint .",
61
- "lint:prettier": "npm run prettier -- --check",
62
- "format": "npm run format:es && npm run format:prettier",
63
- "format:es": "npm run lint:es -- --fix",
64
- "format:prettier": "npm run prettier -- --write",
65
- "prettier": "prettier '**/*.{ts,md,json,yml}'",
66
- "build": "npm run build:cjs && npm run build:esm",
67
- "build:cjs": "tsc --sourceRoot https://raw.githubusercontent.com/fb55/entities/$(git rev-parse HEAD)/src/",
68
- "build:esm": "npm run build:cjs -- --module esnext --target es2019 --outDir lib/esm && echo '{\"type\":\"module\"}' > lib/esm/package.json",
69
68
  "build:docs": "typedoc --hideGenerator src/index.ts",
70
- "build:trie": "ts-node scripts/write-decode-map.ts",
71
- "build:encode-trie": "ts-node scripts/write-encode-map.ts",
72
- "prepare": "npm run build"
69
+ "build:encode-trie": "node --import=tsx scripts/write-encode-map.ts",
70
+ "build:trie": "node --import=tsx scripts/write-decode-map.ts",
71
+ "benchmark": "node --import=tsx scripts/benchmark.ts",
72
+ "format": "npm run format:es && npm run format:biome",
73
+ "format:es": "npm run lint:es -- --fix",
74
+ "format:biome": "biome check --fix .",
75
+ "lint": "npm run lint:es && npm run lint:ts && npm run lint:biome",
76
+ "lint:es": "eslint . --ignore-path .gitignore",
77
+ "lint:biome": "biome check .",
78
+ "lint:ts": "tsc --noEmit",
79
+ "prepublishOnly": "tshy",
80
+ "test": "npm run test:vi && npm run lint",
81
+ "test:vi": "vitest run"
73
82
  },
74
- "repository": {
75
- "type": "git",
76
- "url": "git://github.com/fb55/entities.git"
83
+ "devDependencies": {
84
+ "@biomejs/biome": "^2.3.11",
85
+ "@types/node": "^25.0.9",
86
+ "@typescript-eslint/eslint-plugin": "^8.53.1",
87
+ "@typescript-eslint/parser": "^8.53.1",
88
+ "@vitest/coverage-v8": "^3.2.4",
89
+ "@types/he": "^1.2.3",
90
+ "eslint": "^8.57.1",
91
+ "eslint-config-biome": "^2.1.3",
92
+ "eslint-plugin-n": "^17.23.2",
93
+ "eslint-plugin-unicorn": "^56.0.1",
94
+ "he": "^1.2.0",
95
+ "html-entities": "^2.6.0",
96
+ "parse-entities": "^4.0.2",
97
+ "tinybench": "^5.1.0",
98
+ "tshy": "^3.1.0",
99
+ "tsx": "^4.21.0",
100
+ "typedoc": "^0.28.16",
101
+ "typescript": "^5.9.3",
102
+ "vitest": "^3.2.4"
77
103
  },
78
- "license": "BSD-2-Clause",
79
- "jest": {
80
- "preset": "ts-jest",
81
- "coverageProvider": "v8",
82
- "moduleNameMapper": {
83
- "^(.*)\\.js$": "$1"
84
- }
104
+ "engines": {
105
+ "node": ">=0.12"
85
106
  },
86
- "prettier": {
87
- "tabWidth": 4,
88
- "proseWrap": "always"
107
+ "tshy": {
108
+ "exclude": [
109
+ "**/*.spec.ts",
110
+ "**/__fixtures__/*",
111
+ "**/__tests__/*",
112
+ "**/__snapshots__/*"
113
+ ],
114
+ "exports": {
115
+ ".": "./src/index.ts",
116
+ "./decode": "./src/decode.ts",
117
+ "./escape": "./src/escape.ts"
118
+ }
89
119
  }
90
120
  }
@@ -0,0 +1,289 @@
1
+ export interface BundleOptions {
2
+ intro?: string;
3
+ separator?: string;
4
+ }
5
+
6
+ export interface SourceMapOptions {
7
+ /**
8
+ * Whether the mapping should be high-resolution.
9
+ * Hi-res mappings map every single character, meaning (for example) your devtools will always
10
+ * be able to pinpoint the exact location of function calls and so on.
11
+ * With lo-res mappings, devtools may only be able to identify the correct
12
+ * line - but they're quicker to generate and less bulky.
13
+ * You can also set `"boundary"` to generate a semi-hi-res mappings segmented per word boundary
14
+ * instead of per character, suitable for string semantics that are separated by words.
15
+ * If sourcemap locations have been specified with s.addSourceMapLocation(), they will be used here.
16
+ */
17
+ hires?: boolean | 'boundary';
18
+ /**
19
+ * The filename where you plan to write the sourcemap.
20
+ */
21
+ file?: string;
22
+ /**
23
+ * The filename of the file containing the original source.
24
+ */
25
+ source?: string;
26
+ /**
27
+ * Whether to include the original content in the map's sourcesContent array.
28
+ */
29
+ includeContent?: boolean;
30
+ }
31
+
32
+ export type SourceMapSegment =
33
+ | [number]
34
+ | [number, number, number, number]
35
+ | [number, number, number, number, number];
36
+
37
+ export interface DecodedSourceMap {
38
+ file: string;
39
+ sources: string[];
40
+ sourcesContent?: string[];
41
+ names: string[];
42
+ mappings: SourceMapSegment[][];
43
+ x_google_ignoreList?: number[];
44
+ }
45
+
46
+ export class SourceMap {
47
+ constructor(properties: DecodedSourceMap);
48
+
49
+ version: number;
50
+ file: string;
51
+ sources: string[];
52
+ sourcesContent?: string[];
53
+ names: string[];
54
+ mappings: string;
55
+ x_google_ignoreList?: number[];
56
+ debugId?: string;
57
+
58
+ /**
59
+ * Returns the equivalent of `JSON.stringify(map)`
60
+ */
61
+ toString(): string;
62
+ /**
63
+ * Returns a DataURI containing the sourcemap. Useful for doing this sort of thing:
64
+ * `generateMap(options?: SourceMapOptions): SourceMap;`
65
+ */
66
+ toUrl(): string;
67
+ }
68
+
69
+ export class Bundle {
70
+ constructor(options?: BundleOptions);
71
+ /**
72
+ * Adds the specified source to the bundle, which can either be a `MagicString` object directly,
73
+ * or an options object that holds a magic string `content` property and optionally provides
74
+ * a `filename` for the source within the bundle, as well as an optional `ignoreList` hint
75
+ * (which defaults to `false`). The `filename` is used when constructing the source map for the
76
+ * bundle, to identify this `source` in the source map's `sources` field. The `ignoreList` hint
77
+ * is used to populate the `x_google_ignoreList` extension field in the source map, which is a
78
+ * mechanism for tools to signal to debuggers that certain sources should be ignored by default
79
+ * (depending on user preferences).
80
+ */
81
+ addSource(
82
+ source: MagicString | { filename?: string; content: MagicString; ignoreList?: boolean },
83
+ ): this;
84
+ append(str: string, options?: BundleOptions): this;
85
+ clone(): this;
86
+ generateMap(
87
+ options?: SourceMapOptions,
88
+ ): Omit<SourceMap, 'sourcesContent'> & { sourcesContent: Array<string | null> };
89
+ generateDecodedMap(
90
+ options?: SourceMapOptions,
91
+ ): Omit<DecodedSourceMap, 'sourcesContent'> & { sourcesContent: Array<string | null> };
92
+ getIndentString(): string;
93
+ indent(indentStr?: string): this;
94
+ indentExclusionRanges: ExclusionRange | Array<ExclusionRange>;
95
+ prepend(str: string): this;
96
+ toString(): string;
97
+ trimLines(): this;
98
+ trim(charType?: string): this;
99
+ trimStart(charType?: string): this;
100
+ trimEnd(charType?: string): this;
101
+ isEmpty(): boolean;
102
+ length(): number;
103
+ }
104
+
105
+ export type ExclusionRange = [number, number];
106
+
107
+ export interface MagicStringOptions {
108
+ filename?: string;
109
+ indentExclusionRanges?: ExclusionRange | Array<ExclusionRange>;
110
+ offset?: number;
111
+ }
112
+
113
+ export interface IndentOptions {
114
+ exclude?: ExclusionRange | Array<ExclusionRange>;
115
+ indentStart?: boolean;
116
+ }
117
+
118
+ export interface OverwriteOptions {
119
+ storeName?: boolean;
120
+ contentOnly?: boolean;
121
+ }
122
+
123
+ export interface UpdateOptions {
124
+ storeName?: boolean;
125
+ overwrite?: boolean;
126
+ }
127
+
128
+ export default class MagicString {
129
+ constructor(str: string, options?: MagicStringOptions);
130
+ /**
131
+ * Adds the specified character index (with respect to the original string) to sourcemap mappings, if `hires` is false.
132
+ */
133
+ addSourcemapLocation(char: number): void;
134
+ /**
135
+ * Appends the specified content to the end of the string.
136
+ */
137
+ append(content: string): this;
138
+ /**
139
+ * Appends the specified content at the index in the original string.
140
+ * If a range *ending* with index is subsequently moved, the insert will be moved with it.
141
+ * See also `s.prependLeft(...)`.
142
+ */
143
+ appendLeft(index: number, content: string): this;
144
+ /**
145
+ * Appends the specified content at the index in the original string.
146
+ * If a range *starting* with index is subsequently moved, the insert will be moved with it.
147
+ * See also `s.prependRight(...)`.
148
+ */
149
+ appendRight(index: number, content: string): this;
150
+ /**
151
+ * Does what you'd expect.
152
+ */
153
+ clone(): this;
154
+ /**
155
+ * Generates a version 3 sourcemap.
156
+ */
157
+ generateMap(options?: SourceMapOptions): SourceMap;
158
+ /**
159
+ * Generates a sourcemap object with raw mappings in array form, rather than encoded as a string.
160
+ * Useful if you need to manipulate the sourcemap further, but most of the time you will use `generateMap` instead.
161
+ */
162
+ generateDecodedMap(options?: SourceMapOptions): DecodedSourceMap;
163
+ getIndentString(): string;
164
+
165
+ /**
166
+ * Prefixes each line of the string with prefix.
167
+ * If prefix is not supplied, the indentation will be guessed from the original content, falling back to a single tab character.
168
+ */
169
+ indent(options?: IndentOptions): this;
170
+ /**
171
+ * Prefixes each line of the string with prefix.
172
+ * If prefix is not supplied, the indentation will be guessed from the original content, falling back to a single tab character.
173
+ *
174
+ * The options argument can have an exclude property, which is an array of [start, end] character ranges.
175
+ * These ranges will be excluded from the indentation - useful for (e.g.) multiline strings.
176
+ */
177
+ indent(indentStr?: string, options?: IndentOptions): this;
178
+ indentExclusionRanges: ExclusionRange | Array<ExclusionRange>;
179
+
180
+ /**
181
+ * Moves the characters from `start` and `end` to `index`.
182
+ */
183
+ move(start: number, end: number, index: number): this;
184
+ /**
185
+ * Replaces the characters from `start` to `end` with `content`, along with the appended/prepended content in
186
+ * that range. The same restrictions as `s.remove()` apply.
187
+ *
188
+ * The fourth argument is optional. It can have a storeName property — if true, the original name will be stored
189
+ * for later inclusion in a sourcemap's names array — and a contentOnly property which determines whether only
190
+ * the content is overwritten, or anything that was appended/prepended to the range as well.
191
+ *
192
+ * It may be preferred to use `s.update(...)` instead if you wish to avoid overwriting the appended/prepended content.
193
+ */
194
+ overwrite(
195
+ start: number,
196
+ end: number,
197
+ content: string,
198
+ options?: boolean | OverwriteOptions,
199
+ ): this;
200
+ /**
201
+ * Replaces the characters from `start` to `end` with `content`. The same restrictions as `s.remove()` apply.
202
+ *
203
+ * The fourth argument is optional. It can have a storeName property — if true, the original name will be stored
204
+ * for later inclusion in a sourcemap's names array — and an overwrite property which determines whether only
205
+ * the content is overwritten, or anything that was appended/prepended to the range as well.
206
+ */
207
+ update(start: number, end: number, content: string, options?: boolean | UpdateOptions): this;
208
+ /**
209
+ * Prepends the string with the specified content.
210
+ */
211
+ prepend(content: string): this;
212
+ /**
213
+ * Same as `s.appendLeft(...)`, except that the inserted content will go *before* any previous appends or prepends at index
214
+ */
215
+ prependLeft(index: number, content: string): this;
216
+ /**
217
+ * Same as `s.appendRight(...)`, except that the inserted content will go *before* any previous appends or prepends at `index`
218
+ */
219
+ prependRight(index: number, content: string): this;
220
+ /**
221
+ * Removes the characters from `start` to `end` (of the original string, **not** the generated string).
222
+ * Removing the same content twice, or making removals that partially overlap, will cause an error.
223
+ */
224
+ remove(start: number, end: number): this;
225
+ /**
226
+ * Reset the modified characters from `start` to `end` (of the original string, **not** the generated string).
227
+ */
228
+ reset(start: number, end: number): this;
229
+ /**
230
+ * Returns the content of the generated string that corresponds to the slice between `start` and `end` of the original string.
231
+ * Throws error if the indices are for characters that were already removed.
232
+ */
233
+ slice(start: number, end: number): string;
234
+ /**
235
+ * Returns a clone of `s`, with all content before the `start` and `end` characters of the original string removed.
236
+ */
237
+ snip(start: number, end: number): this;
238
+ /**
239
+ * Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the start and end.
240
+ */
241
+ trim(charType?: string): this;
242
+ /**
243
+ * Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the start.
244
+ */
245
+ trimStart(charType?: string): this;
246
+ /**
247
+ * Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the end.
248
+ */
249
+ trimEnd(charType?: string): this;
250
+ /**
251
+ * Removes empty lines from the start and end.
252
+ */
253
+ trimLines(): this;
254
+ /**
255
+ * String replacement with RegExp or string.
256
+ */
257
+ replace(
258
+ regex: RegExp | string,
259
+ replacement: string | ((substring: string, ...args: any[]) => string),
260
+ ): this;
261
+ /**
262
+ * Same as `s.replace`, but replace all matched strings instead of just one.
263
+ */
264
+ replaceAll(
265
+ regex: RegExp | string,
266
+ replacement: string | ((substring: string, ...args: any[]) => string),
267
+ ): this;
268
+
269
+ lastChar(): string;
270
+ lastLine(): string;
271
+ /**
272
+ * Returns true if the resulting source is empty (disregarding white space).
273
+ */
274
+ isEmpty(): boolean;
275
+ length(): number;
276
+
277
+ /**
278
+ * Indicates if the string has been changed.
279
+ */
280
+ hasChanged(): boolean;
281
+
282
+ original: string;
283
+ /**
284
+ * Returns the generated string.
285
+ */
286
+ toString(): string;
287
+
288
+ offset: number;
289
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nanoid",
3
- "version": "3.3.11",
3
+ "version": "3.3.20",
4
4
  "description": "A tiny (116 bytes), secure URL-friendly unique string ID generator",
5
5
  "keywords": [
6
6
  "uuid",
@@ -52,11 +52,11 @@
52
52
  "./async": {
53
53
  "browser": "./async/index.browser.js",
54
54
  "require": {
55
- "types": "./index.d.cts",
55
+ "types": "./async/index.d.cts",
56
56
  "default": "./async/index.cjs"
57
57
  },
58
58
  "import": {
59
- "types": "./index.d.ts",
59
+ "types": "./async/index.d.ts",
60
60
  "default": "./async/index.js"
61
61
  },
62
62
  "default": "./async/index.js"
@@ -49,7 +49,6 @@ declare namespace AtRule {
49
49
  raws?: AtRuleRaws
50
50
  }
51
51
 
52
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
53
52
  export { AtRule_ as default }
54
53
  }
55
54
 
@@ -26,7 +26,6 @@ declare namespace Comment {
26
26
  text: string
27
27
  }
28
28
 
29
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
30
29
  export { Comment_ as default }
31
30
  }
32
31
 
@@ -8,11 +8,7 @@ import Rule from './rule.js'
8
8
  declare namespace Container {
9
9
  export type ContainerWithChildren<Child extends Node = ChildNode> = {
10
10
  nodes: Child[]
11
- } & (
12
- | AtRule
13
- | Root
14
- | Rule
15
- )
11
+ } & (AtRule | Root | Rule)
16
12
 
17
13
  export interface ValueOptions {
18
14
  /**
@@ -43,7 +39,6 @@ declare namespace Container {
43
39
  | string
44
40
  | undefined
45
41
 
46
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
47
42
  export { Container_ as default }
48
43
  }
49
44
 
@@ -183,23 +178,6 @@ declare abstract class Container_<Child extends Node = ChildNode> extends Node {
183
178
  */
184
179
  insertAfter(oldNode: Child | number, newNode: Container.NewChild): this
185
180
 
186
- /**
187
- * Traverses the container’s descendant nodes, calling callback
188
- * for each comment node.
189
- *
190
- * Like `Container#each`, this method is safe
191
- * to use if you are mutating arrays during iteration.
192
- *
193
- * ```js
194
- * root.walkComments(comment => {
195
- * comment.remove()
196
- * })
197
- * ```
198
- *
199
- * @param callback Iterator receives each node and index.
200
- * @return Returns `false` if iteration was broke.
201
- */
202
-
203
181
  /**
204
182
  * Insert new node before old node within the container.
205
183
  *
@@ -383,9 +361,22 @@ declare abstract class Container_<Child extends Node = ChildNode> extends Node {
383
361
  callback: (atRule: AtRule, index: number) => false | void
384
362
  ): false | undefined
385
363
 
386
- walkComments(
387
- callback: (comment: Comment, indexed: number) => false | void
388
- ): false | undefined
364
+ /**
365
+ * Traverses the container’s descendant nodes, calling callback
366
+ * for each comment node.
367
+ *
368
+ * Like `Container#each`, this method is safe
369
+ * to use if you are mutating arrays during iteration.
370
+ *
371
+ * ```js
372
+ * root.walkComments(comment => {
373
+ * comment.remove()
374
+ * })
375
+ * ```
376
+ *
377
+ * @param callback Iterator receives each node and index.
378
+ * @return Returns `false` if iteration was broke.
379
+ */
389
380
  walkComments(
390
381
  callback: (comment: Comment, indexed: number) => false | void
391
382
  ): false | undefined
@@ -16,7 +16,6 @@ declare namespace CssSyntaxError {
16
16
  line: number
17
17
  }
18
18
 
19
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
20
19
  export { CssSyntaxError_ as default }
21
20
  }
22
21
 
@@ -1,5 +1,5 @@
1
1
  import { ContainerWithChildren } from './container.js'
2
- import Node from './node.js'
2
+ import Node, { NodeProps } from './node.js'
3
3
 
4
4
  declare namespace Declaration {
5
5
  export interface DeclarationRaws extends Record<string, unknown> {
@@ -28,7 +28,7 @@ declare namespace Declaration {
28
28
  }
29
29
  }
30
30
 
31
- export interface DeclarationProps {
31
+ export interface DeclarationProps extends NodeProps {
32
32
  /** Whether the declaration has an `!important` annotation. */
33
33
  important?: boolean
34
34
  /** Name of the declaration. */
@@ -39,7 +39,6 @@ declare namespace Declaration {
39
39
  value: string
40
40
  }
41
41
 
42
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
43
42
  export { Declaration_ as default }
44
43
  }
45
44
 
@@ -82,8 +81,8 @@ declare class Declaration_ extends Node {
82
81
  * root.first.last.important //=> undefined
83
82
  * ```
84
83
  */
85
- get important(): boolean
86
- set important(value: boolean)
84
+ get important(): boolean | undefined
85
+ set important(value: boolean | undefined)
87
86
 
88
87
  /**
89
88
  * The property name for a CSS declaration.
@@ -16,7 +16,6 @@ declare namespace Document {
16
16
  raws?: Record<string, any>
17
17
  }
18
18
 
19
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
20
19
  export { Document_ as default }
21
20
  }
22
21
 
@@ -4,6 +4,6 @@ interface FromJSON extends JSONHydrator {
4
4
  default: FromJSON
5
5
  }
6
6
 
7
- declare const fromJSON: FromJSON
7
+ declare let fromJSON: FromJSON
8
8
 
9
9
  export = fromJSON
@@ -49,7 +49,6 @@ declare namespace Input {
49
49
  url: string
50
50
  }
51
51
 
52
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
53
52
  export { Input_ as default }
54
53
  }
55
54