Skip to content

Commit

Permalink
fix(less): fix importer
Browse files Browse the repository at this point in the history
  • Loading branch information
Anidetrix committed Mar 20, 2020
1 parent aec5e13 commit 7900186
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/loaders/less/import-plugin.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import fs from "fs-extra";
import { FileManager, LoadedFile, Plugin } from "less";
import less, { LoadedFile, Plugin } from "less";
import resolveAsync from "../../utils/resolve-async";
import { moduleRe, getUrlOfPartial } from "../../utils/resolve-utils";

class StylesFileManager extends FileManager {
class StylesFileManager extends less.FileManager {
supports(): boolean {
return true;
}
Expand Down
6 changes: 3 additions & 3 deletions src/typings/less.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ declare module "less" {

export type LoadOptions = { [k: string]: unknown };

export class FileManager {
class FileManager {
supports(filename: string, currentDirectory: string, options: LoadOptions): boolean;
supportsSync(filename: string, currentDirectory: string, options: LoadOptions): boolean;
loadFile(filename: string, currentDirectory: string, options: LoadOptions): Promise<LoadedFile>;
loadFileSync(filename: string, currentDirectory: string, options: LoadOptions): LoadedFileSync;
}

export class PluginManager {
class PluginManager {
constructor(less: Less);
addPreProcessor(preProcessor: PreProcessor, priority?: number): void;
addFileManager(fileManager: FileManager): void;
Expand Down Expand Up @@ -112,7 +112,7 @@ declare module "less" {
sheets: HTMLLinkElement[];
version: number[];

FileManager: FileManager;
FileManager: typeof FileManager;

render(input: string, callback: RenderCallback): void;
render(input: string, options: Options, callback: RenderCallback): void;
Expand Down
2 changes: 1 addition & 1 deletion src/typings/stylus.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ declare module "stylus" {
render(str: string, options: RenderOptions, callback: RenderCallback): void;
}

export class Renderer {
class Renderer {
constructor(str: string);
constructor(str: string, options: RenderOptions);
sourcemap?: ExistingRawSourceMap;
Expand Down

0 comments on commit 7900186

Please sign in to comment.