Skip to content

Commit

Permalink
Merge pull request #79 from embroider-build/cjs-types
Browse files Browse the repository at this point in the history
Provide correct types when using cjs with moduleResolution:nodenext
  • Loading branch information
ef4 authored Sep 21, 2024
2 parents 8ea2451 + b2abf50 commit d024873
Show file tree
Hide file tree
Showing 4 changed files with 1,967 additions and 2,861 deletions.
58 changes: 58 additions & 0 deletions index.d.cts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* wasm-pack doesn't give us correct enough types.
* this file must be manually kept in sync with ./index.d.ts
*/



interface Parsed {
type: 'expression' | 'class-member';
tagName: 'template';
contents: string;
range: {
start: number;
end: number;
};
contentRange: {
start: number;
end: number;
};
startRange: {
end: number;
start: number;
};
endRange: {
start: number;
end: number;
};
}

interface PreprocessorOptions {

/** Default is `false` */
inline_source_map?: boolean;

filename?: string;

}

/**
*/
export class Preprocessor {
free(): void;
/**
*/
constructor();
/**
* @param {string} src
* @param {PreprocessorOptions | undefined} options
* @returns {string}
*/
process(src: string, options?: PreprocessorOptions): string;
/**
* @param {string} src
* @param {PreprocessorOptions | undefined} options
* @returns {any}
*/
parse(src: string, options?: PreprocessorOptions): Parsed[];
}
3 changes: 1 addition & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/*
* wasm-pack doesn't give us correct enough types.
* this file must be manually kept in sync with ./index.d.cts
*/



interface Parsed {
type: 'expression' | 'class-member';
tagName: 'template';
Expand Down
Loading

0 comments on commit d024873

Please sign in to comment.