@autorest/openapi-to-typespec
Version:
Autorest plugin to scaffold a Typespec definition from an OpenAPI document
48 lines • 1.67 kB
TypeScript
import { Schema } from "@autorest/codemodel";
interface LibraryPropertyBase {
serializedName: string;
required: boolean;
type: string;
}
interface LibraryPrimitiveProperty extends LibraryPropertyBase {
type: "primitive";
typeName: string;
}
interface LibraryNonPrimitiveProperty extends LibraryPropertyBase {
type: "nonPrimitive";
schema: () => LibraryType;
}
type LibraryProperty = LibraryPrimitiveProperty | LibraryNonPrimitiveProperty;
interface LibraryTypeBase {
name: string;
type: string;
}
interface LibraryObjectType extends LibraryTypeBase {
type: "object";
properties: Record<string, LibraryProperty>;
}
interface LibraryArrayType extends LibraryTypeBase {
type: "array";
elementType: () => LibraryType;
}
interface LibraryPrimitiveType extends LibraryTypeBase {
type: "primitive";
schema: (schema: Schema) => boolean;
}
interface LibraryEnumType extends LibraryTypeBase {
type: "enum";
sealed: boolean;
values: Record<string, string>;
}
interface LibraryDictionaryType extends LibraryTypeBase {
type: "dictionary";
valueType: () => LibraryType;
}
export type LibraryType = LibraryObjectType | LibraryEnumType | LibraryArrayType | LibraryPrimitiveType | LibraryDictionaryType;
export declare function isEquivalent(schema: Schema, expected: LibraryType): boolean;
export declare const skuLibraryType: LibraryObjectType;
export declare const extendedLocationLibraryType: LibraryObjectType;
export declare const planLibraryType: LibraryObjectType;
export declare const managedServiceIdentityLibraryType: LibraryObjectType;
export {};
//# sourceMappingURL=library-type-mapping.d.ts.map