@rspack-canary/test-tools 1.5.9-canary-a915dabc-20251013174148 → 1.5.9-canary-e259bc79-20251014173821

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 (83) hide show
  1. package/dist/case/hot-step.d.ts +1 -1
  2. package/dist/case/hot-step.js +12 -10
  3. package/dist/case/hot.d.ts +5 -4
  4. package/dist/case/hot.js +32 -41
  5. package/dist/case/incremental.d.ts +1 -1
  6. package/dist/case/incremental.js +8 -6
  7. package/dist/case/normal.js +0 -4
  8. package/dist/case/watch.js +0 -7
  9. package/dist/helper/hot-update/plugin.d.ts +1 -1
  10. package/dist/helper/hot-update/plugin.js +4 -4
  11. package/dist/helper/legacy/update.d.ts +2 -0
  12. package/dist/helper/legacy/update.esm.d.ts +1 -0
  13. package/dist/helper/legacy/update.esm.js +23 -0
  14. package/dist/helper/legacy/update.js +19 -0
  15. package/dist/helper/util/checkStats.d.ts +0 -1
  16. package/dist/helper/util/checkStats.js +0 -18
  17. package/dist/index.d.ts +0 -1
  18. package/dist/index.js +0 -1
  19. package/dist/jest/ignore-snapshot-default-reporter.d.ts +2 -0
  20. package/dist/jest/ignore-snapshot-default-reporter.js +57 -0
  21. package/dist/jest/ignore-snapshot-summary-reporter.d.ts +2 -0
  22. package/dist/jest/ignore-snapshot-summary-reporter.js +24 -0
  23. package/dist/jest/patch-node-env.d.ts +5 -0
  24. package/dist/jest/patch-node-env.js +18 -0
  25. package/dist/jest/slash.d.ts +2 -0
  26. package/dist/jest/slash.js +16 -0
  27. package/package.json +9 -6
  28. package/dist/helper/legacy/createLogger.d.ts +0 -23
  29. package/dist/helper/legacy/createLogger.js +0 -20
  30. package/dist/helper/legacy/diffStats.d.ts +0 -2
  31. package/dist/helper/legacy/diffStats.js +0 -13
  32. package/dist/helper/legacy/supportsBlob.d.ts +0 -2
  33. package/dist/helper/legacy/supportsBlob.js +0 -10
  34. package/dist/helper/legacy/supportsClassFields.d.ts +0 -2
  35. package/dist/helper/legacy/supportsClassFields.js +0 -11
  36. package/dist/helper/legacy/supportsES6.d.ts +0 -2
  37. package/dist/helper/legacy/supportsES6.js +0 -11
  38. package/dist/helper/legacy/supportsForOf.d.ts +0 -2
  39. package/dist/helper/legacy/supportsForOf.js +0 -11
  40. package/dist/helper/legacy/supportsIteratorDestructuring.d.ts +0 -2
  41. package/dist/helper/legacy/supportsIteratorDestructuring.js +0 -11
  42. package/dist/helper/legacy/supportsLogicalAssignment.d.ts +0 -2
  43. package/dist/helper/legacy/supportsLogicalAssignment.js +0 -11
  44. package/dist/helper/legacy/supportsObjectDestructuring.d.ts +0 -2
  45. package/dist/helper/legacy/supportsObjectDestructuring.js +0 -11
  46. package/dist/helper/legacy/supportsOptionalCatchBinding.d.ts +0 -2
  47. package/dist/helper/legacy/supportsOptionalCatchBinding.js +0 -11
  48. package/dist/helper/legacy/supportsOptionalChaining.d.ts +0 -2
  49. package/dist/helper/legacy/supportsOptionalChaining.js +0 -11
  50. package/dist/helper/legacy/supportsRequireInModule.d.ts +0 -2
  51. package/dist/helper/legacy/supportsRequireInModule.js +0 -5
  52. package/dist/helper/legacy/supportsResponse.d.ts +0 -2
  53. package/dist/helper/legacy/supportsResponse.js +0 -10
  54. package/dist/helper/legacy/supportsSpread.d.ts +0 -2
  55. package/dist/helper/legacy/supportsSpread.js +0 -12
  56. package/dist/helper/legacy/supportsTemplateStrings.d.ts +0 -2
  57. package/dist/helper/legacy/supportsTemplateStrings.js +0 -11
  58. package/dist/helper/legacy/supportsTextDecoder.d.ts +0 -2
  59. package/dist/helper/legacy/supportsTextDecoder.js +0 -10
  60. package/dist/helper/legacy/supportsWebAssembly.d.ts +0 -2
  61. package/dist/helper/legacy/supportsWebAssembly.js +0 -10
  62. package/dist/helper/legacy/supportsWorker.d.ts +0 -2
  63. package/dist/helper/legacy/supportsWorker.js +0 -17
  64. package/dist/helper/legacy/warmup-webpack.d.ts +0 -1
  65. package/dist/helper/legacy/warmup-webpack.js +0 -26
  66. package/dist/helper/loaders/hot-update.d.ts +0 -1
  67. package/dist/helper/loaders/hot-update.js +0 -43
  68. package/dist/helper/plugins/hot-update.d.ts +0 -7
  69. package/dist/helper/plugins/hot-update.js +0 -40
  70. package/dist/helper/plugins/index.d.ts +0 -1
  71. package/dist/helper/plugins/index.js +0 -17
  72. package/dist/helper/util/currentWatchStep.d.ts +0 -1
  73. package/dist/helper/util/currentWatchStep.js +0 -2
  74. package/dist/helper/util/identifier.d.ts +0 -76
  75. package/dist/helper/util/identifier.js +0 -339
  76. package/dist/helper/util/replaceMitteDiagnostic.d.ts +0 -2
  77. package/dist/helper/util/replaceMitteDiagnostic.js +0 -17
  78. package/dist/reporter/diff-html.d.ts +0 -15
  79. package/dist/reporter/diff-html.js +0 -69
  80. package/dist/reporter/diff-stats.d.ts +0 -24
  81. package/dist/reporter/diff-stats.js +0 -131
  82. package/dist/reporter/index.d.ts +0 -2
  83. package/dist/reporter/index.js +0 -18
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack-canary/test-tools",
3
- "version": "1.5.9-canary-a915dabc-20251013174148",
3
+ "version": "1.5.9-canary-e259bc79-20251014173821",
4
4
  "license": "MIT",
5
5
  "description": "Test tools for rspack",
6
6
  "main": "dist/index.js",
@@ -15,7 +15,8 @@
15
15
  "./package.json": "./package.json",
16
16
  "./helper/*": "./dist/helper/*.js",
17
17
  "./helper/legacy/*": "./dist/helper/legacy/*.js",
18
- "./helper/util/*": "./dist/helper/util/*.js"
18
+ "./helper/util/*": "./dist/helper/util/*.js",
19
+ "./jest/*": "./dist/jest/*.js"
19
20
  },
20
21
  "files": [
21
22
  "client",
@@ -39,6 +40,7 @@
39
40
  "@babel/parser": "7.28.4",
40
41
  "@babel/traverse": "7.28.4",
41
42
  "@babel/types": "7.28.4",
43
+ "@jest/reporters": "29.7.0",
42
44
  "cross-env": "^10.1.0",
43
45
  "csv-to-markdown-table": "1.5.0",
44
46
  "deepmerge": "^4.3.1",
@@ -49,6 +51,7 @@
49
51
  "iconv-lite": "^0.6.3",
50
52
  "jest-diff": "^29.7.0",
51
53
  "jest-snapshot": "29.7.0",
54
+ "jest-environment-node": "29.7.0",
52
55
  "jsdom": "^26.1.0",
53
56
  "memfs": "4.48.1",
54
57
  "loader-utils": "^2.0.4",
@@ -100,10 +103,10 @@
100
103
  "wast-loader": "^1.14.1",
101
104
  "worker-rspack-loader": "^3.1.2",
102
105
  "exports-loader": "^5.0.0",
103
- "@rspack/cli": "npm:@rspack-canary/cli@1.5.9-canary-a915dabc-20251013174148",
104
- "@rspack/core": "npm:@rspack-canary/core@1.5.9-canary-a915dabc-20251013174148",
105
- "@rspack/test-tools": "npm:@rspack-canary/test-tools@1.5.9-canary-a915dabc-20251013174148",
106
- "@rspack/binding-testing": "1.4.1"
106
+ "@rspack/cli": "npm:@rspack-canary/cli@1.5.9-canary-e259bc79-20251014173821",
107
+ "@rspack/binding-testing": "1.4.1",
108
+ "@rspack/core": "npm:@rspack-canary/core@1.5.9-canary-e259bc79-20251014173821",
109
+ "@rspack/test-tools": "npm:@rspack-canary/test-tools@1.5.9-canary-e259bc79-20251014173821"
107
110
  },
108
111
  "peerDependencies": {
109
112
  "@rspack/core": ">=1.0.0"
@@ -1,23 +0,0 @@
1
- declare function _exports(appendTarget: any): {
2
- log: (l: any) => any;
3
- debug: (l: any) => any;
4
- trace: (l: any) => any;
5
- info: (l: any) => any;
6
- warn: {
7
- (...data: any[]): void;
8
- (message?: any, ...optionalParams: any[]): void;
9
- };
10
- error: {
11
- (...data: any[]): void;
12
- (message?: any, ...optionalParams: any[]): void;
13
- };
14
- logTime: () => void;
15
- group: () => void;
16
- groupCollapsed: () => void;
17
- groupEnd: () => void;
18
- profile: () => void;
19
- profileEnd: () => void;
20
- clear: () => void;
21
- status: () => void;
22
- };
23
- export = _exports;
@@ -1,20 +0,0 @@
1
- "use strict";
2
- // @ts-nocheck
3
- module.exports = appendTarget => {
4
- return {
5
- log: l => appendTarget.push(l),
6
- debug: l => appendTarget.push(l),
7
- trace: l => appendTarget.push(l),
8
- info: l => appendTarget.push(l),
9
- warn: console.warn.bind(console),
10
- error: console.error.bind(console),
11
- logTime: () => { },
12
- group: () => { },
13
- groupCollapsed: () => { },
14
- groupEnd: () => { },
15
- profile: () => { },
16
- profileEnd: () => { },
17
- clear: () => { },
18
- status: () => { }
19
- };
20
- };
@@ -1,2 +0,0 @@
1
- declare function _exports(rawStats: any, name: any): string;
2
- export = _exports;
@@ -1,13 +0,0 @@
1
- "use strict";
2
- // @ts-nocheck
3
- const diff = require("jest-diff").diff;
4
- const { stripVTControlCharacters: stripAnsi } = require("node:util");
5
- const processStats = str => {
6
- return str.trim().split('\n').map(i => i.trim()).join('\n').replace(/\d+(\.\d+)?/g, 'XX').replace(/"/g, "");
7
- };
8
- const webpackStats = require('../__snapshots__/StatsTestCases.basictest.js.snap.webpack');
9
- module.exports = (rawStats, name) => {
10
- const key = `StatsTestCases should print correct stats for ${name} 1`;
11
- const res = stripAnsi(diff(processStats(rawStats), processStats(webpackStats[key] || ''), { expand: false, contextLines: 0 }));
12
- return res;
13
- };
@@ -1,2 +0,0 @@
1
- declare function _exports(): boolean;
2
- export = _exports;
@@ -1,10 +0,0 @@
1
- "use strict";
2
- // @ts-nocheck
3
- module.exports = function supportsBlob() {
4
- try {
5
- return typeof Blob !== "undefined";
6
- }
7
- catch (_err) {
8
- return false;
9
- }
10
- };
@@ -1,2 +0,0 @@
1
- declare function _exports(): boolean;
2
- export = _exports;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- // @ts-nocheck
3
- module.exports = function supportsES6() {
4
- try {
5
- eval("class A { #field = 1 }");
6
- return true;
7
- }
8
- catch (e) {
9
- return false;
10
- }
11
- };
@@ -1,2 +0,0 @@
1
- declare function _exports(): boolean;
2
- export = _exports;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- // @ts-nocheck
3
- module.exports = function supportsES6() {
4
- try {
5
- eval("class A {}");
6
- return true;
7
- }
8
- catch (e) {
9
- return false;
10
- }
11
- };
@@ -1,2 +0,0 @@
1
- declare function _exports(): boolean;
2
- export = _exports;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- // @ts-nocheck
3
- module.exports = function supportDefaultAssignment() {
4
- try {
5
- var f = eval("(function f() { for(var x of ['ok', 'fail']) return x; })");
6
- return f() === "ok";
7
- }
8
- catch (e) {
9
- return false;
10
- }
11
- };
@@ -1,2 +0,0 @@
1
- declare function _exports(): boolean;
2
- export = _exports;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- // @ts-nocheck
3
- module.exports = function supportsIteratorDestructuring() {
4
- try {
5
- var f = eval("(function f([, x, ...y]) { return x; })");
6
- return f([1, 2]) === 2;
7
- }
8
- catch (e) {
9
- return false;
10
- }
11
- };
@@ -1,2 +0,0 @@
1
- declare function _exports(): any;
2
- export = _exports;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- // @ts-nocheck
3
- module.exports = function supportsLogicalAssignment() {
4
- try {
5
- var f = eval("(function f() { var x = null; x ??= true; x &&= true; return x ||= false; })");
6
- return f();
7
- }
8
- catch (e) {
9
- return false;
10
- }
11
- };
@@ -1,2 +0,0 @@
1
- declare function _exports(): boolean;
2
- export = _exports;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- // @ts-nocheck
3
- module.exports = function supportsObjectDestructuring() {
4
- try {
5
- var f = eval("(function f({x, y}) { return x + y; })");
6
- return f({ x: 1, y: 2 }) === 3;
7
- }
8
- catch (e) {
9
- return false;
10
- }
11
- };
@@ -1,2 +0,0 @@
1
- declare function _exports(): boolean;
2
- export = _exports;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- // @ts-nocheck
3
- module.exports = function supportsOptionalCatchBinding() {
4
- try {
5
- eval("try {} catch {}");
6
- return true;
7
- }
8
- catch (e) {
9
- return false;
10
- }
11
- };
@@ -1,2 +0,0 @@
1
- declare function _exports(): any;
2
- export = _exports;
@@ -1,11 +0,0 @@
1
- // @ts-nocheck
2
- "use strict";
3
- module.exports = function supportsOptionalChaining() {
4
- try {
5
- const f = eval("(function f() { return ({a: true}) ?.a })");
6
- return f();
7
- }
8
- catch (_err) {
9
- return false;
10
- }
11
- };
@@ -1,2 +0,0 @@
1
- declare function _exports(): boolean;
2
- export = _exports;
@@ -1,5 +0,0 @@
1
- "use strict";
2
- // @ts-nocheck
3
- module.exports = function supportsRequireInModule() {
4
- return !!require("module").createRequire;
5
- };
@@ -1,2 +0,0 @@
1
- declare function _exports(): boolean;
2
- export = _exports;
@@ -1,10 +0,0 @@
1
- "use strict";
2
- // @ts-nocheck
3
- module.exports = function supportsResponse() {
4
- try {
5
- return typeof Response !== "undefined";
6
- }
7
- catch (_err) {
8
- return false;
9
- }
10
- };
@@ -1,2 +0,0 @@
1
- declare function _exports(): any;
2
- export = _exports;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- // @ts-nocheck
3
- module.exports = function supportsSpread() {
4
- try {
5
- var x = { a: true }, y; // eslint-disable-line no-unused-vars
6
- eval("y = { ...x }");
7
- return y !== x && y.a;
8
- }
9
- catch (e) {
10
- return false;
11
- }
12
- };
@@ -1,2 +0,0 @@
1
- declare function _exports(): boolean;
2
- export = _exports;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- // @ts-nocheck
3
- module.exports = function supportsTemplateStrings() {
4
- try {
5
- var f = eval("(function f() { return String.raw`a\\b`; })");
6
- return f() === "a\\b";
7
- }
8
- catch (e) {
9
- return false;
10
- }
11
- };
@@ -1,2 +0,0 @@
1
- declare function _exports(): boolean;
2
- export = _exports;
@@ -1,10 +0,0 @@
1
- // @ts-nocheck
2
- "use strict";
3
- module.exports = function supportsTextDecoder() {
4
- try {
5
- return typeof TextDecoder !== "undefined";
6
- }
7
- catch (_err) {
8
- return false;
9
- }
10
- };
@@ -1,2 +0,0 @@
1
- declare function _exports(): boolean;
2
- export = _exports;
@@ -1,10 +0,0 @@
1
- "use strict";
2
- // @ts-nocheck
3
- module.exports = function supportsWebAssembly() {
4
- try {
5
- return typeof WebAssembly !== "undefined";
6
- }
7
- catch (e) {
8
- return false;
9
- }
10
- };
@@ -1,2 +0,0 @@
1
- declare function _exports(): boolean;
2
- export = _exports;
@@ -1,17 +0,0 @@
1
- "use strict";
2
- // @ts-nocheck
3
- const nodeVersion = process.versions.node.split(".").map(Number);
4
- module.exports = function supportsWorker() {
5
- // Verify that in the current node version new Worker() accepts URL as the first parameter:
6
- // https://nodejs.org/api/worker_threads.html#worker_threads_new_worker_filename_options
7
- if (nodeVersion[0] >= 14) {
8
- return true;
9
- }
10
- else if (nodeVersion[0] === 13 && nodeVersion[1] >= 12) {
11
- return true;
12
- }
13
- else if (nodeVersion[0] === 12 && nodeVersion[1] >= 17) {
14
- return true;
15
- }
16
- return false;
17
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,26 +0,0 @@
1
- "use strict";
2
- // @ts-nocheck
3
- describe("warmup", () => {
4
- it("should warmup webpack", done => {
5
- let webpack = require("@rspack/core");
6
- const END = new Error("end warmup");
7
- webpack({
8
- entry: "data:text/javascript,import 'data:text/javascript,'",
9
- plugins: [
10
- c => c.hooks.emit.tap("Warmup", () => {
11
- throw END;
12
- })
13
- ]
14
- }, err => {
15
- webpack = undefined;
16
- try {
17
- // CHANGE: rspack will format error into diagnostic.
18
- expect(err.message).toContain("end warmup");
19
- done();
20
- }
21
- catch (e) {
22
- done(e);
23
- }
24
- });
25
- }, 300000);
26
- });
@@ -1 +0,0 @@
1
- export default function (this: any, c: string): string;
@@ -1,43 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = default_1;
4
- function default_1(c) {
5
- let content = c;
6
- if (content.includes("NEXT_HMR")) {
7
- content = `
8
- ${content}
9
- let __hmr_children__ = [...module.children];
10
- let __hmr_used_exports__ = __hmr_children__.reduce((res, child) => {
11
- if (__webpack_module_cache__[child]) {
12
- res[child] = __webpack_module_cache__[child].exports;
13
- }
14
- return res;
15
- }, {});
16
- module.hot.accept(__hmr_children__, () => {
17
- __hmr_children__.forEach((child) => {
18
- const reexports = __webpack_require__(child);
19
- for (let key in reexports) {
20
- if (!__hmr_used_exports__[child]) { continue; }
21
- Object.defineProperty(__hmr_used_exports__[child], key, {
22
- configurable: true,
23
- enumerable: true,
24
- get: () => reexports[key]
25
- });
26
- }
27
- });
28
- });
29
- `;
30
- }
31
- content = content.replace(/NEXT_HMR/g, "NEXT_HMR.bind(null, module)");
32
- const options = this.getOptions();
33
- const items = content.split(/---+\r?\n/g);
34
- if (items.length <= 1) {
35
- return content;
36
- }
37
- options.totalUpdates = Math.max(options.totalUpdates, items.length);
38
- options.changedFiles.push(this.resourcePath);
39
- if (options.updateIndex >= items.length) {
40
- return items[items.length - 1];
41
- }
42
- return items[options.updateIndex];
43
- }
@@ -1,7 +0,0 @@
1
- import type { Compiler } from "@rspack/core";
2
- import type { THotUpdateContext } from "../../type";
3
- export declare class TestHotUpdatePlugin {
4
- private updateOptions;
5
- constructor(updateOptions: THotUpdateContext);
6
- apply(compiler: Compiler): void;
7
- }
@@ -1,40 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TestHotUpdatePlugin = void 0;
4
- class TestHotUpdatePlugin {
5
- constructor(updateOptions) {
6
- this.updateOptions = updateOptions;
7
- }
8
- apply(compiler) {
9
- let isRebuild = false;
10
- compiler.hooks.beforeRun.tap("TestHotUpdatePlugin", () => {
11
- if (isRebuild) {
12
- compiler.modifiedFiles = new Set(this.updateOptions.changedFiles);
13
- }
14
- else {
15
- compiler.modifiedFiles = new Set();
16
- }
17
- this.updateOptions.changedFiles = [];
18
- isRebuild = true;
19
- });
20
- compiler.hooks.compilation.tap("TestHotUpdatePlugin", compilation => {
21
- compilation.hooks.additionalTreeRuntimeRequirements.tap("HMR_TEST_PLUGIN", (_chunk, set) => {
22
- set.add(compiler.webpack.RuntimeGlobals.moduleCache);
23
- });
24
- compilation.hooks.runtimeModule.tap("HMR_TEST_PLUGIN", (module, _set) => {
25
- if (module.constructorName === "DefinePropertyGettersRuntimeModule") {
26
- module.source.source = Buffer.from(`
27
- __webpack_require__.d = function (exports, definition) {
28
- for (var key in definition) {
29
- if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
30
- Object.defineProperty(exports, key, { configurable: true, enumerable: true, get: definition[key] });
31
- }
32
- }
33
- };
34
- `, "utf-8");
35
- }
36
- });
37
- });
38
- }
39
- }
40
- exports.TestHotUpdatePlugin = TestHotUpdatePlugin;
@@ -1 +0,0 @@
1
- export * from "./hot-update";
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./hot-update"), exports);
@@ -1 +0,0 @@
1
- export const step: {};
@@ -1,2 +0,0 @@
1
- "use strict";
2
- exports.step = {};
@@ -1,76 +0,0 @@
1
- /**
2
- * @param {string} context context used to create relative path
3
- * @param {string} identifier identifier used to create relative path
4
- * @param {Object=} associatedObjectForCache an object to which the cache will be attached
5
- * @returns {string} the returned relative path
6
- */
7
- export function makePathsRelative(context: string, identifier: string, associatedObjectForCache?: Object | undefined): string;
8
- export namespace makePathsRelative {
9
- /**
10
- * @param {Object=} associatedObjectForCache an object to which the cache will be attached
11
- * @returns {function(string, string): string} cached function
12
- */
13
- function bindCache(associatedObjectForCache?: Object | undefined): (arg0: string, arg1: string) => string;
14
- /**
15
- * @param {string} context context used to create relative path
16
- * @param {Object=} associatedObjectForCache an object to which the cache will be attached
17
- * @returns {function(string): string} cached function
18
- */
19
- function bindContextCache(context: string, associatedObjectForCache?: Object | undefined): (arg0: string) => string;
20
- }
21
- /**
22
- * @param {string} context context used to create relative path
23
- * @param {string} identifier identifier used to create relative path
24
- * @param {Object=} associatedObjectForCache an object to which the cache will be attached
25
- * @returns {string} the returned relative path
26
- */
27
- export function makePathsRelative(context: string, identifier: string, associatedObjectForCache?: Object | undefined): string;
28
- export namespace makePathsRelative { }
29
- /**
30
- * @param {string} str the path with query and fragment
31
- * @param {Object=} associatedObjectForCache an object to which the cache will be attached
32
- * @returns {ParsedResource} parsed parts
33
- */
34
- export function parseResource(str: string, associatedObjectForCache?: Object | undefined): ParsedResource;
35
- export namespace parseResource {
36
- function bindCache(associatedObjectForCache: any): (str: any) => any;
37
- }
38
- /**
39
- * @param {string} str the path with query and fragment
40
- * @param {Object=} associatedObjectForCache an object to which the cache will be attached
41
- * @returns {ParsedResource} parsed parts
42
- */
43
- export function parseResource(str: string, associatedObjectForCache?: Object | undefined): ParsedResource;
44
- export namespace parseResource { }
45
- export function getUndoPath(filename: string, outputPath: string, enforceRelative: boolean): string;
46
- export type MakeRelativePathsCache = {
47
- relativePaths?: Map<string, Map<string, string>> | undefined;
48
- };
49
- export type ParsedResource = {
50
- resource: string;
51
- path: string;
52
- query: string;
53
- fragment: string;
54
- };
55
- export type ParsedResourceWithoutFragment = {
56
- resource: string;
57
- path: string;
58
- query: string;
59
- };
60
- /**
61
- * @param {string} context context used to create relative path
62
- * @param {string} identifier identifier used to create relative path
63
- * @param {Object=} associatedObjectForCache an object to which the cache will be attached
64
- * @returns {string} the returned relative path
65
- */
66
- declare function makePathsRelative(context: string, identifier: string, associatedObjectForCache?: Object | undefined): string;
67
- declare namespace makePathsRelative { }
68
- /**
69
- * @param {string} context context used to create relative path
70
- * @param {string} identifier identifier used to create relative path
71
- * @param {Object=} associatedObjectForCache an object to which the cache will be attached
72
- * @returns {string} the returned relative path
73
- */
74
- declare function makePathsRelative(context: string, identifier: string, associatedObjectForCache?: Object | undefined): string;
75
- declare namespace makePathsRelative { }
76
- export { contextify, absolutify };