Skip to content

Commit

Permalink
move hooks type
Browse files Browse the repository at this point in the history
  • Loading branch information
valya committed Aug 13, 2024
1 parent 31001cb commit 26e0ef9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/ExpressionBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type { DataNode } from './VariablePolyfill';
import { splitExpression } from './ExpressionSplitter';
import type { ExpressionCode, ExpressionText } from './ExpressionSplitter';
import { parseWithEsprimaNext } from './Parser';
import type { TournamentHooks } from './';
import type { TournamentHooks } from './ast';

export interface ExpressionAnalysis {
has: {
Expand Down
5 changes: 5 additions & 0 deletions src/ast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ export { builders as astBuilders, type namedTypes as astNamedTypes } from 'ast-t
import type { types } from 'recast';
import type { namedTypes } from 'ast-types';

export interface TournamentHooks {
before: ASTBeforeHook[];
after: ASTAfterHook[];
}

export type ASTAfterHook = (
ast: namedTypes.ExpressionStatement,
dataNode: namedTypes.ThisExpression | namedTypes.Identifier,
Expand Down
7 changes: 1 addition & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { ExpressionAnalysis } from './ExpressionBuilder';
import { getTmplDifference } from './Analysis';
import type { ExpressionEvaluator, ExpressionEvaluatorClass } from './Evaluator';
import { FunctionEvaluator } from './FunctionEvaluator';
import type { ASTBeforeHook, ASTAfterHook } from './ast';
import type { TournamentHooks } from './ast';

export type { TmplDifference } from './Analysis';
export type { ExpressionEvaluator, ExpressionEvaluatorClass } from './Evaluator';
Expand All @@ -12,11 +12,6 @@ export * from './ast';
const DATA_NODE_NAME = '___n8n_data';
export type ReturnValue = string | null | (() => unknown);

export interface TournamentHooks {
before: ASTBeforeHook[];
after: ASTAfterHook[];
}

export class Tournament {
private evaluator!: ExpressionEvaluator;

Expand Down

0 comments on commit 26e0ef9

Please sign in to comment.