Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
{
   "code": 1,
   "message": "compile fail",
   "data": {
       "diagnostics": []
   }
}

2、move-api

2.1 git.d.ts

Code Block
import { WasmFs } from '@wasmer/wasmfs';
/**
 * Git interface
 */
export interface IGit {
    /**
     * Download code to dest path
     *
     * @param repoUrl
     * @param destPath
     */
    download(repoUrl: string, destPath: string): Promise<void>;
}
/**
 * Git
 *
 */
export declare class Git implements IGit {
    wasmfs?: WasmFs;
    constructor(wasmfs: WasmFs);
    download(zipURL: string, destPath: string): Promise<void>;
}

2.2 package.d.ts

Code Block
import { WasmFs } from '@wasmer/wasmfs';
export interface IDependency {
    git?: string;
    rev?: string;
    local?: string;
}
export interface IMovePackage {
    name?: string;
    version?: string;
    addresses?: Map<string, string>;
    dependencies?: Map<string, IDependency>;
    devDependencies?: Map<string, IDependency>;
    build(): void;
}
export declare type MoveOptions = {
    packagePath: string;
    test: boolean;
    alias?: Map<string, string>;
    initFunction?: string;
};
export declare class MovePackage implements IMovePackage {
    name?: string;
    version?: string;
    addresses?: Map<string, string>;
    devDependencies?: Map<string, IDependency>;
    dependencies?: Map<string, IDependency>;
    private wasmfs;
    private packagePath;
    private packageAlias;
    private test;
    private initFunction?;
    constructor(wasmfs: WasmFs, opts: MoveOptions);
    parseToml(tomlContent: string): void;
    parseDeps(thisDeps: Map<string, IDependency>, tomlDeps: any): void;
    build(): Promise<void>;
    getAllDeps(): string[];
    collectDependencies(allDeps: string[], modules: Map<string, IDependency>): void;
    getAllAddresses(): Map<string, string>;
    collectAddresses(allAddresss: Map<string, string>, modules: Map<string, IDependency>): void;
    buildPackage(wasmfs: WasmFs, packagePath: string, deps: string[], addresses: Map<string, string>): Promise<void>;
}

3.3 disassemble.d.ts

Code Block
import { WasmFs } from '@wasmer/wasmfs';
export interface IDisassemble {
    disassemble(name: string, bytecode: string, callback: (ok: boolean, data: string) => void): Promise<void>;
}
export declare class Disassemble implements IDisassemble {
    private wasmfs;
    constructor(wasmfs: WasmFs);
    disassemble(name: string, bytecode: string, callback: (ok: boolean, data: string) => void): Promise<void>;
}