mirror of https://github.com/sveltejs/svelte
This reverts commit 94c271c433.
pull/6100/head
parent
94c271c433
commit
60976e56a7
@ -0,0 +1,32 @@
|
|||||||
|
import { Location } from 'locate-character';
|
||||||
|
|
||||||
|
export interface Source {
|
||||||
|
source: string;
|
||||||
|
get_location: (search: number) => Location;
|
||||||
|
file_basename: string;
|
||||||
|
filename: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Processed {
|
||||||
|
code: string;
|
||||||
|
map?: string | object; // we are opaque with the type here to avoid dependency on the remapping module for our public types.
|
||||||
|
dependencies?: string[];
|
||||||
|
toString?: () => string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type MarkupPreprocessor = (options: {
|
||||||
|
content: string;
|
||||||
|
filename: string;
|
||||||
|
}) => Processed | Promise<Processed>;
|
||||||
|
|
||||||
|
export type Preprocessor = (options: {
|
||||||
|
content: string;
|
||||||
|
attributes: Record<string, string | boolean>;
|
||||||
|
filename?: string;
|
||||||
|
}) => Processed | Promise<Processed>;
|
||||||
|
|
||||||
|
export interface PreprocessorGroup {
|
||||||
|
markup?: MarkupPreprocessor;
|
||||||
|
style?: Preprocessor;
|
||||||
|
script?: Preprocessor;
|
||||||
|
}
|
||||||
Loading…
Reference in new issue