@graphprotocol/graph-cli
Version:
CLI for building for and deploying to The Graph
85 lines (84 loc) • 3.24 kB
TypeScript
declare class Param {
name: string;
type: string | NamedType | ArrayType | NullableType;
constructor(name: string, type: string | NamedType | ArrayType | NullableType);
toString(): string;
}
declare class Method {
name: string;
params: Param[];
returnType: string | NamedType | ArrayType | NullableType | null | undefined;
body: string;
constructor(name: string, params: Param[], returnType: string | NamedType | ArrayType | NullableType | null | undefined, body: string);
toString(): string;
}
declare class StaticMethod {
name: string;
params: Param[];
returnType: NamedType | NullableType;
body: string;
constructor(name: string, params: Param[], returnType: NamedType | NullableType, body: string);
toString(): string;
}
interface ClassOptions {
extends?: string;
export?: boolean;
}
declare class Class {
name: string;
extends: string | undefined;
methods: string[];
members: any[];
export: boolean;
constructor(name: string, options: ClassOptions);
addMember(member: any): void;
addMethod(method: any): void;
toString(): string;
}
declare class ClassMember {
name: string;
type: string;
constructor(name: string, type: string);
toString(): string;
}
declare class NamedType {
name: string;
constructor(name: string);
toString(): string;
capitalize(): this;
/**
* Returns the default value for the type, or null if the type is not a primitive
*
* Learn more: https://www.assemblyscript.org/types.html
*/
getPrimitiveDefault(): false | 0 | null;
isPrimitive(): boolean;
}
declare class ArrayType {
inner: NamedType;
name: string;
constructor(inner: NamedType);
toString(): string;
}
declare class NullableType {
inner: NamedType | ArrayType;
constructor(inner: NamedType | ArrayType);
toString(): string;
}
declare class ModuleImports {
nameOrNames: string | string[];
module: string;
constructor(nameOrNames: string | string[], module: string);
toString(): string;
}
declare const namedType: (name: string) => NamedType;
declare const arrayType: (name: NamedType) => ArrayType;
declare const param: (name: string, type: string | NamedType | ArrayType | NullableType) => Param;
declare const method: (name: string, params: Param[], returnType: string | NamedType | ArrayType | NullableType | null | undefined, body: string) => Method;
declare const staticMethod: (name: string, params: Param[], returnType: NamedType | NullableType, body: string) => StaticMethod;
declare const klass: (name: string, options: ClassOptions) => Class;
declare const klassMember: (name: string, type: string) => ClassMember;
declare const nullableType: (type: NamedType | ArrayType) => NullableType;
declare const moduleImports: (nameOrNames: string | string[], module: string) => ModuleImports;
declare const GENERATED_FILE_NOTE = "\n// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.\n";
export { ArrayType, arrayType, Class, ClassMember, GENERATED_FILE_NOTE, klass, klassMember, Method, method, ModuleImports, moduleImports, NamedType, namedType, NullableType, nullableType, Param, param, StaticMethod, staticMethod, };