UNPKG

@autorest/go

Version:
99 lines 3.46 kB
import * as client from './client.js'; import * as result from './result.js'; import * as type from './type.js'; /** * represents an external Go module. this is used * by the containing-module switch when emitting * packages into an existing module. */ export interface ContainingModule { kind: 'containingModule'; /** * the containing module's identity. * e.g. github.com/contoso/module */ identity: string; /** * the subpackage to emit. * NOTE: callers MUST set this post construction */ package: Package; } /** represents the package used for fakes content */ export interface FakePackage { kind: 'fake'; /** the container for this package */ parent: PackageContent; } /** represents a Go module */ export interface Module extends PackageBase { kind: 'module'; /** * the module's identity. * e.g. github.com/contoso/module */ identity: string; } /** represents a Go package */ export interface Package extends PackageBase { kind: 'package'; /** the name of the package */ name: string; /** the container for this package */ parent: ContainingModule | Module | Package; } /** represents the _test package for an existing package */ export interface TestPackage { kind: 'test'; /** the package containing the source for the test package */ src: PackageContent; } /** provides access to module and package contents */ export type PackageContent = Module | Package; /** the complete set of package types */ export type PackageType = FakePackage | PackageContent | TestPackage; /** * returns the package name for the specified input. * for module github.com/contoso/module, 'module' is returned. * any major version suffix on the module is removed. * * @param pkg is the package source * @returns the package name for pkg */ export declare function getPackageName(pkg: FakePackage | PackageContent | TestPackage): string; interface PackageBase { /** all of the struct model types to generate (models.go file). can be empty */ models: Array<type.Model | type.PolymorphicModel>; /** all of the const types to generate (constants.go file). can be empty */ constants: Array<type.Constant>; /** all of the operation clients. can be empty */ clients: Array<client.Client>; /** all of the parameter groups including the options types (options.go file) */ paramGroups: Array<type.Struct>; /** all of the response envelopes (responses.go file). can be empty */ responseEnvelopes: Array<result.ResponseEnvelope>; /** all of the interfaces for discriminated types (interfaces.go file) */ interfaces: Array<type.Interface>; /** any subpackages within this package. can be empty */ packages: Array<Package>; } declare class PackageBase implements PackageBase { constructor(); } export declare class ContainingModule implements ContainingModule { constructor(identity: string); } export declare class FakePackage implements FakePackage { constructor(parent: PackageContent); } export declare class Module extends PackageBase implements Module { constructor(identity: string); } export declare class Package extends PackageBase implements Package { constructor(name: string, parent: ContainingModule | Module | Package); } export declare class TestPackage implements TestPackage { constructor(src: PackageContent); } export {}; //# sourceMappingURL=module.d.ts.map