-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(types): trimmed down vendor types
- Loading branch information
Showing
9 changed files
with
181 additions
and
268 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
declare namespace fibers { | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
class Fiber {} | ||
} | ||
|
||
declare module "fibers" { | ||
const fiber: fibers.Fiber; | ||
export = fiber; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
declare namespace less { | ||
interface File { | ||
contents?: string; | ||
filename?: string; | ||
} | ||
|
||
class AbstractFileManager { | ||
supportsSync(filename: string, basedir: string): boolean; | ||
} | ||
|
||
interface FileManager extends AbstractFileManager { | ||
supports(filename: string, basedir: string): boolean; | ||
loadFile(filename: string, basedir: string): Promise<File>; | ||
} | ||
|
||
class PluginManager { | ||
constructor(less: Less); | ||
addFileManager(fileManager: FileManager): void; | ||
} | ||
|
||
interface Plugin { | ||
install: (less: Less, pluginManager: PluginManager) => void; | ||
} | ||
|
||
interface SourceMapOption { | ||
sourceMapURL?: string; | ||
sourceMapBasepath?: string; | ||
sourceMapRootpath?: string; | ||
outputSourceFiles?: boolean; | ||
sourceMapFileInline?: boolean; | ||
} | ||
|
||
interface Options { | ||
sourceMap?: SourceMapOption; | ||
filename?: string; | ||
paths?: string[]; | ||
lint?: boolean; | ||
plugins?: Plugin[]; | ||
compress?: boolean; | ||
strictImports?: boolean; | ||
insecure?: boolean; | ||
depends?: boolean; | ||
maxLineLen?: number; | ||
color?: boolean; | ||
ieCompat?: boolean; | ||
javascriptEnabled?: boolean; | ||
dumpLineNumbers?: "comment" | string; | ||
rootpath?: string; | ||
math?: "always" | "strict" | "parens-division" | "parens" | "strict-legacy" | number; | ||
silent?: boolean; | ||
strictUnits?: boolean; | ||
globalVars?: { [x: string]: string }; | ||
modifyVars?: { [x: string]: string }; | ||
syncImport?: boolean; | ||
} | ||
|
||
interface RenderOutput { | ||
css: string; | ||
map: string; | ||
imports: string[]; | ||
} | ||
|
||
interface Less { | ||
AbstractFileManager: typeof AbstractFileManager; | ||
render(input: string, options?: Options): Promise<RenderOutput>; | ||
} | ||
} | ||
|
||
declare module "less" { | ||
const less: less.Less; | ||
export = less; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/// <reference types="./fibers" /> | ||
|
||
declare namespace sass { | ||
type Data = { file: string } | { contents: string } | Error | null; | ||
|
||
type Importer = (url: string, prev: string, done: (data: Data) => void) => Data | void; | ||
|
||
interface Options { | ||
fiber?: fibers.Fiber; | ||
file?: string; | ||
data?: string; | ||
importer?: Importer | Importer[]; | ||
includePaths?: string[]; | ||
indentedSyntax?: boolean; | ||
indentType?: "space" | "tab"; | ||
indentWidth?: number; | ||
linefeed?: "cr" | "crlf" | "lf" | "lfcr"; | ||
omitSourceMapUrl?: boolean; | ||
outFile?: string; | ||
outputStyle?: "compressed" | "expanded"; | ||
sourceMap?: boolean | string; | ||
sourceMapContents?: boolean; | ||
sourceMapEmbed?: boolean; | ||
sourceMapRoot?: string; | ||
} | ||
|
||
interface Exception extends Error { | ||
message: string; | ||
formatted: string; | ||
line: number; | ||
column: number; | ||
status: number; | ||
file: string; | ||
} | ||
|
||
interface Result { | ||
css: Uint8Array; | ||
map?: Uint8Array; | ||
stats: { includedFiles: string[] }; | ||
} | ||
|
||
type Callback = (exception: Exception, result: Result) => void; | ||
|
||
interface Sass { | ||
render: (options: Options, callback: Callback) => void; | ||
} | ||
} | ||
|
||
declare module "sass" { | ||
const sass: sass.Sass; | ||
export = sass; | ||
} | ||
|
||
declare module "node-sass" { | ||
const sass: sass.Sass; | ||
export = sass; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
declare namespace stylus { | ||
interface Options { | ||
imports?: string[]; | ||
paths?: string[]; | ||
filename?: string; | ||
sourcemap?: { | ||
comment?: boolean; | ||
inline?: boolean; | ||
sourceRoot?: string; | ||
basePath?: string; | ||
}; | ||
} | ||
|
||
type Callback = (err: Error, css: string, js: string) => void; | ||
|
||
interface Renderer { | ||
render(callback: Callback): void; | ||
deps(): string[]; | ||
set<T extends keyof Options>(key: T, val: Options[T]): this; | ||
sourcemap?: { | ||
version: number; | ||
sources: string[]; | ||
names: string[]; | ||
sourceRoot?: string; | ||
sourcesContent?: string[]; | ||
mappings: string; | ||
file: string; | ||
}; | ||
} | ||
|
||
interface Stylus { | ||
(code: string, options?: Options): Renderer; | ||
} | ||
} | ||
|
||
declare module "stylus" { | ||
const stylus: stylus.Stylus; | ||
export = stylus; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.