Skip to content

Commit

Permalink
Update the TypeScript typings
Browse files Browse the repository at this point in the history
  • Loading branch information
cedx committed Aug 31, 2024
1 parent 7bc522a commit b3733d7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 52 deletions.
36 changes: 7 additions & 29 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,33 +1,9 @@
import {Transform, type TransformCallback} from "node:stream";
import type File from "vinyl";

/**
* Creates a new plugin.
* @param options The plugin options.
* @returns The newly created instance.
*/
export default function phpMinifier(options?: Partial<GulpPluginOptions>): GulpPlugin;
import {Transform} from "node:stream";

/**
* Minifies PHP source code by removing comments and whitespace.
*/
export declare class GulpPlugin extends Transform {

/**
* Creates a new plugin.
* @param options An object providing values to initialize this instance.
*/
constructor(options?: Partial<GulpPluginOptions>);

/**
* Transforms input and produces output.
* @param chunk The chunk to transform.
* @param encoding The encoding type if the chunk is a string.
* @param callback The function to invoke when the supplied chunk has been processed.
* @returns The transformed chunk.
*/
_transform(chunk: File, encoding: NodeJS.BufferEncoding, callback: TransformCallback): Promise<File>;
}
export declare class GulpPlugin extends Transform {}

/**
* Defines the options of a {@link GulpPlugin} instance.
Expand All @@ -42,7 +18,7 @@ export interface GulpPluginOptions {
/**
* The operation mode of the plugin.
*/
mode: TransformMode;
mode: "fast"|"safe";

/**
* Value indicating whether to silence the plugin output.
Expand All @@ -51,6 +27,8 @@ export interface GulpPluginOptions {
}

/**
* The operation mode of the minifier.
* Creates a new plugin.
* @param options The plugin options.
* @returns The newly created instance.
*/
export type TransformMode = "fast"|"safe";
export default function phpMinifier(options?: Partial<GulpPluginOptions>): GulpPlugin;
25 changes: 3 additions & 22 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
},
"devDependencies": {
"@types/node": "^22.5.1",
"@types/vinyl": "^2.0.12",
"esbuild": "^0.23.1",
"vinyl": "^3.0.0"
},
Expand Down

0 comments on commit b3733d7

Please sign in to comment.