-
Notifications
You must be signed in to change notification settings - Fork 28
/
utils.d.ts
30 lines (22 loc) · 1.13 KB
/
utils.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { SolcInput, SolcOutput } from './solc';
import { Node, NodeType, NodeTypeMap } from './node';
import { SourceUnit } from './types';
import { isNodeType, ExtendedNodeType, ExtendedNodeTypeMap } from './utils/is-node-type';
export { isNodeType, ExtendedNodeType, ExtendedNodeTypeMap };
export { findAll } from './utils/find-all';
export interface NodeWithSourceUnit<N extends Node = Node> {
node: N;
sourceUnit: SourceUnit;
}
export interface ASTDereferencer {
<T extends ExtendedNodeType>(nodeType: T | readonly T[]): (id: number) => ExtendedNodeTypeMap[T];
<T extends ExtendedNodeType>(nodeType: T | readonly T[], id: number): ExtendedNodeTypeMap[T];
withSourceUnit<T extends ExtendedNodeType>(nodeType: T | readonly T[], id: number): NodeWithSourceUnit<ExtendedNodeTypeMap[T]>;
}
export function astDereferencer(solcOutput: SolcOutput): ASTDereferencer;
export class ASTDereferencerError extends Error {
readonly id: number;
readonly nodeType: readonly ExtendedNodeType[];
}
export type SrcDecoder = (node: { src: string }) => string;
export function srcDecoder(solcInput: SolcInput, solcOutput: SolcOutput): SrcDecoder;