content-tag
Advanced tools
Comparing version 2.0.3 to 3.0.0
@@ -49,3 +49,3 @@ /* | ||
*/ | ||
process(src: string, options?: PreprocessorOptions): string; | ||
process(src: string, options?: PreprocessorOptions): { code: string; map: string; }; | ||
/** | ||
@@ -52,0 +52,0 @@ * @param {string} src |
{ | ||
"name": "content-tag", | ||
"version": "2.0.3", | ||
"version": "3.0.0", | ||
"description": "A rust program that uses a fork of swc to parse and transform Javascript containing the content-tag proposal", | ||
@@ -5,0 +5,0 @@ "repository": { |
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export const memory: WebAssembly.Memory; | ||
export function __wbg_codemappair_free(a: number, b: number): void; | ||
export function __wbg_get_codemappair_code(a: number): Array; | ||
export function __wbg_set_codemappair_code(a: number, b: number, c: number): void; | ||
export function __wbg_get_codemappair_map(a: number): Array; | ||
export function __wbg_set_codemappair_map(a: number, b: number, c: number): void; | ||
export function codemappair_new(a: number, b: number, c: number, d: number): number; | ||
export function __wbg_preprocessor_free(a: number, b: number): void; | ||
@@ -11,6 +17,6 @@ export function preprocessor_new(): number; | ||
export const __wbindgen_export_2: WebAssembly.Table; | ||
export function __wbindgen_free(a: number, b: number, c: number): void; | ||
export function __externref_table_dealloc(a: number): void; | ||
export function __wbindgen_free(a: number, b: number, c: number): void; | ||
export function __wbindgen_exn_store(a: number): void; | ||
export function __externref_table_alloc(): number; | ||
export function __wbindgen_start(): void; |
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export class CodeMapPair { | ||
free(): void; | ||
/** | ||
* @param {string} code | ||
* @param {string} map | ||
*/ | ||
constructor(code: string, map: string); | ||
code: string; | ||
map: string; | ||
} | ||
export class Preprocessor { | ||
@@ -9,5 +19,5 @@ free(): void; | ||
* @param {any} options | ||
* @returns {string} | ||
* @returns {CodeMapPair} | ||
*/ | ||
process(src: string, options: any): string; | ||
process(src: string, options: any): CodeMapPair; | ||
/** | ||
@@ -14,0 +24,0 @@ * @param {string} src |
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export const memory: WebAssembly.Memory; | ||
export function __wbg_codemappair_free(a: number, b: number): void; | ||
export function __wbg_get_codemappair_code(a: number): Array; | ||
export function __wbg_set_codemappair_code(a: number, b: number, c: number): void; | ||
export function __wbg_get_codemappair_map(a: number): Array; | ||
export function __wbg_set_codemappair_map(a: number, b: number, c: number): void; | ||
export function codemappair_new(a: number, b: number, c: number, d: number): number; | ||
export function __wbg_preprocessor_free(a: number, b: number): void; | ||
@@ -11,6 +17,6 @@ export function preprocessor_new(): number; | ||
export const __wbindgen_export_2: WebAssembly.Table; | ||
export function __wbindgen_free(a: number, b: number, c: number): void; | ||
export function __externref_table_dealloc(a: number): void; | ||
export function __wbindgen_free(a: number, b: number, c: number): void; | ||
export function __wbindgen_exn_store(a: number): void; | ||
export function __externref_table_alloc(): number; | ||
export function __wbindgen_start(): void; |
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export class CodeMapPair { | ||
free(): void; | ||
/** | ||
* @param {string} code | ||
* @param {string} map | ||
*/ | ||
constructor(code: string, map: string); | ||
code: string; | ||
map: string; | ||
} | ||
export class Preprocessor { | ||
@@ -9,5 +19,5 @@ free(): void; | ||
* @param {any} options | ||
* @returns {string} | ||
* @returns {CodeMapPair} | ||
*/ | ||
process(src: string, options: any): string; | ||
process(src: string, options: any): CodeMapPair; | ||
/** | ||
@@ -25,2 +35,8 @@ * @param {string} src | ||
readonly memory: WebAssembly.Memory; | ||
readonly __wbg_codemappair_free: (a: number, b: number) => void; | ||
readonly __wbg_get_codemappair_code: (a: number) => Array; | ||
readonly __wbg_set_codemappair_code: (a: number, b: number, c: number) => void; | ||
readonly __wbg_get_codemappair_map: (a: number) => Array; | ||
readonly __wbg_set_codemappair_map: (a: number, b: number, c: number) => void; | ||
readonly codemappair_new: (a: number, b: number, c: number, d: number) => number; | ||
readonly __wbg_preprocessor_free: (a: number, b: number) => void; | ||
@@ -33,4 +49,4 @@ readonly preprocessor_new: () => number; | ||
readonly __wbindgen_export_2: WebAssembly.Table; | ||
readonly __wbindgen_free: (a: number, b: number, c: number) => void; | ||
readonly __externref_table_dealloc: (a: number) => void; | ||
readonly __wbindgen_free: (a: number, b: number, c: number) => void; | ||
readonly __wbindgen_exn_store: (a: number) => void; | ||
@@ -37,0 +53,0 @@ readonly __externref_table_alloc: () => number; |
@@ -174,2 +174,89 @@ let wasm; | ||
const CodeMapPairFinalization = (typeof FinalizationRegistry === 'undefined') | ||
? { register: () => {}, unregister: () => {} } | ||
: new FinalizationRegistry(ptr => wasm.__wbg_codemappair_free(ptr >>> 0, 1)); | ||
export class CodeMapPair { | ||
static __wrap(ptr) { | ||
ptr = ptr >>> 0; | ||
const obj = Object.create(CodeMapPair.prototype); | ||
obj.__wbg_ptr = ptr; | ||
CodeMapPairFinalization.register(obj, obj.__wbg_ptr, obj); | ||
return obj; | ||
} | ||
__destroy_into_raw() { | ||
const ptr = this.__wbg_ptr; | ||
this.__wbg_ptr = 0; | ||
CodeMapPairFinalization.unregister(this); | ||
return ptr; | ||
} | ||
free() { | ||
const ptr = this.__destroy_into_raw(); | ||
wasm.__wbg_codemappair_free(ptr, 0); | ||
} | ||
/** | ||
* @returns {string} | ||
*/ | ||
get code() { | ||
let deferred1_0; | ||
let deferred1_1; | ||
try { | ||
const ret = wasm.__wbg_get_codemappair_code(this.__wbg_ptr); | ||
deferred1_0 = ret[0]; | ||
deferred1_1 = ret[1]; | ||
return getStringFromWasm0(ret[0], ret[1]); | ||
} finally { | ||
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1); | ||
} | ||
} | ||
/** | ||
* @param {string} arg0 | ||
*/ | ||
set code(arg0) { | ||
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
wasm.__wbg_set_codemappair_code(this.__wbg_ptr, ptr0, len0); | ||
} | ||
/** | ||
* @returns {string} | ||
*/ | ||
get map() { | ||
let deferred1_0; | ||
let deferred1_1; | ||
try { | ||
const ret = wasm.__wbg_get_codemappair_map(this.__wbg_ptr); | ||
deferred1_0 = ret[0]; | ||
deferred1_1 = ret[1]; | ||
return getStringFromWasm0(ret[0], ret[1]); | ||
} finally { | ||
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1); | ||
} | ||
} | ||
/** | ||
* @param {string} arg0 | ||
*/ | ||
set map(arg0) { | ||
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
wasm.__wbg_set_codemappair_map(this.__wbg_ptr, ptr0, len0); | ||
} | ||
/** | ||
* @param {string} code | ||
* @param {string} map | ||
*/ | ||
constructor(code, map) { | ||
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
const ptr1 = passStringToWasm0(map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
const len1 = WASM_VECTOR_LEN; | ||
const ret = wasm.codemappair_new(ptr0, len0, ptr1, len1); | ||
this.__wbg_ptr = ret >>> 0; | ||
CodeMapPairFinalization.register(this, this.__wbg_ptr, this); | ||
return this; | ||
} | ||
} | ||
const PreprocessorFinalization = (typeof FinalizationRegistry === 'undefined') | ||
@@ -201,23 +288,12 @@ ? { register: () => {}, unregister: () => {} } | ||
* @param {any} options | ||
* @returns {string} | ||
* @returns {CodeMapPair} | ||
*/ | ||
process(src, options) { | ||
let deferred3_0; | ||
let deferred3_1; | ||
try { | ||
const ptr0 = passStringToWasm0(src, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
const ret = wasm.preprocessor_process(this.__wbg_ptr, ptr0, len0, options); | ||
var ptr2 = ret[0]; | ||
var len2 = ret[1]; | ||
if (ret[3]) { | ||
ptr2 = 0; len2 = 0; | ||
throw takeFromExternrefTable0(ret[2]); | ||
} | ||
deferred3_0 = ptr2; | ||
deferred3_1 = len2; | ||
return getStringFromWasm0(ptr2, len2); | ||
} finally { | ||
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1); | ||
const ptr0 = passStringToWasm0(src, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
const ret = wasm.preprocessor_process(this.__wbg_ptr, ptr0, len0, options); | ||
if (ret[2]) { | ||
throw takeFromExternrefTable0(ret[1]); | ||
} | ||
return CodeMapPair.__wrap(ret[0]); | ||
} | ||
@@ -224,0 +300,0 @@ /** |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
2360563
1130