UNPKG

webcrack

Version:

Deobfuscate, unminify and unpack bundled javascript

25 lines 981 B
import { parse } from '@babel/parser'; import template from '@babel/template'; import traverse, { type Visitor } from '@babel/traverse'; import * as t from '@babel/types'; import * as m from '@codemod/matchers'; export type Stage = 'afterParse' | 'afterPrepare' | 'afterDeobfuscate' | 'afterUnminify' | 'afterUnpack'; export type PluginState = { opts: Record<string, unknown>; }; export interface PluginObject { name?: string; pre?: (this: PluginState, state: PluginState) => Promise<void> | void; post?: (this: PluginState, state: PluginState) => Promise<void> | void; visitor?: Visitor<PluginState>; } export interface PluginAPI { parse: typeof parse; types: typeof t; traverse: typeof traverse; template: typeof template; matchers: typeof m; } export type Plugin = (api: PluginAPI) => PluginObject; export declare function runPlugins(ast: t.File, plugins: Plugin[], state: PluginState): Promise<void>; //# sourceMappingURL=plugin.d.ts.map