2021-09-22 13:41:25 +00:00
|
|
|
import {
|
|
|
|
// ethereum,
|
|
|
|
// store,
|
|
|
|
log
|
|
|
|
// ipfs,
|
|
|
|
// json,
|
|
|
|
// crypto,
|
2021-09-20 10:46:29 +00:00
|
|
|
|
2021-09-22 13:41:25 +00:00
|
|
|
// dataSource,
|
|
|
|
// ens,
|
|
|
|
|
|
|
|
// typeConversion,
|
|
|
|
|
|
|
|
// bigDecimal,
|
|
|
|
// bigInt,
|
|
|
|
|
|
|
|
// Address,
|
|
|
|
// BigDecimal,
|
|
|
|
// BigInt,
|
|
|
|
// ByteArray,
|
|
|
|
// Bytes,
|
|
|
|
// DataSourceContext,
|
|
|
|
// DataSourceTemplate,
|
|
|
|
// Entity,
|
|
|
|
// JSONValue,
|
|
|
|
// JSONValueKind,
|
|
|
|
// JSONValuePayload,
|
|
|
|
// Result,
|
|
|
|
// TypedMap,
|
|
|
|
// TypedMapEntry,
|
|
|
|
// Value,
|
|
|
|
// ValueKind,
|
|
|
|
// ValuePayload,
|
|
|
|
// Wrapped
|
|
|
|
} from '@graphprotocol/graph-ts';
|
|
|
|
|
2021-10-05 12:22:51 +00:00
|
|
|
/* eslint-disable @typescript-eslint/no-namespace */
|
|
|
|
export declare namespace test {
|
|
|
|
export function asyncMethod(): i32;
|
|
|
|
}
|
|
|
|
|
2021-09-22 13:41:25 +00:00
|
|
|
export function callGraphAPI (): void {
|
|
|
|
log.debug('hello {}', ['world']);
|
2021-09-20 10:46:29 +00:00
|
|
|
}
|
2021-09-23 11:15:23 +00:00
|
|
|
|
2021-10-05 12:22:51 +00:00
|
|
|
export function callAsyncMethod (): void {
|
|
|
|
log.debug('calling async method', []);
|
|
|
|
const res = test.asyncMethod();
|
|
|
|
log.debug('res after async: {}', [res.toString()]);
|
|
|
|
}
|
|
|
|
|
2021-09-23 11:15:23 +00:00
|
|
|
export class Foo {
|
|
|
|
static getFoo (): Foo {
|
|
|
|
return new Foo();
|
|
|
|
}
|
|
|
|
|
|
|
|
getString (): string {
|
|
|
|
return 'hello world!';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export const FooID = idof<Foo>();
|
2021-10-05 12:22:51 +00:00
|
|
|
|
|
|
|
export class Bar {
|
2023-03-24 06:31:33 +00:00
|
|
|
prop: string;
|
2021-10-05 12:22:51 +00:00
|
|
|
|
|
|
|
constructor (prop: string) {
|
|
|
|
this.prop = prop;
|
|
|
|
}
|
|
|
|
|
|
|
|
getProp (): string {
|
|
|
|
return this.prop;
|
|
|
|
}
|
|
|
|
}
|
2021-11-29 13:07:11 +00:00
|
|
|
|
|
|
|
export function testLog (): void {
|
|
|
|
log.debug('Debug message: {}, {}', ['value1', 'value2']);
|
|
|
|
log.info('Info message: {}', ['value1', 'value2']);
|
|
|
|
log.warning('Warning message', []);
|
|
|
|
log.error('Error message', []);
|
|
|
|
log.critical('Critical message', []);
|
|
|
|
}
|
2021-12-21 10:28:17 +00:00
|
|
|
|
|
|
|
export function testMemory (value: string): void {
|
|
|
|
log.debug('testMemory value:', [value.slice(0, 10)]);
|
|
|
|
}
|