Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(readme): added types #660

Merged
merged 7 commits into from
Jan 20, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,13 @@ const template = /\[\\*([\w:]+)\\*\]/i;
/**
* @callback Filter
* @param {string} filepath
* @returns {boolean}
*/

/**
* @callback TransformAllFunction
* @param {{ data: Buffer, sourceFilename: string, absoluteFilename: string }[]} data
* @returns {string}
*/

/**
Expand Down
4 changes: 3 additions & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,12 @@ export = CopyPlugin;
/**
* @callback Filter
* @param {string} filepath
* @returns {boolean}
*/
/**
* @callback TransformAllFunction
* @param {{ data: Buffer, sourceFilename: string, absoluteFilename: string }[]} data
* @returns {string}
harish-sethuraman marked this conversation as resolved.
Show resolved Hide resolved
*/
/**
* @typedef { { [key: string]: string } | ((item: { absoluteFilename: string, sourceFilename: string, filename: string, toType: ToType }) => { [key: string]: string }) } Info
Expand Down Expand Up @@ -256,7 +258,7 @@ type TransformAllFunction = (
sourceFilename: string;
absoluteFilename: string;
}[]
) => any;
) => string;
type Info =
| {
[key: string]: string;
Expand Down