UNPKG

@odata2ts/odata2ts

Version:

Flexible generator to produce various TypeScript artefacts (from simple model interfaces to complete odata clients) from OData metadata files

61 lines (60 loc) 2.4 kB
import { RunOptions } from "../OptionModel.js"; import { NamespaceWithAlias } from "./DataModel.js"; export interface NamingHelperSettings extends Pick<RunOptions, "allowRenaming" | "naming"> { } export declare class NamingHelper { private readonly allowModelPropRenaming; private readonly mainServiceName; private readonly namespacePrefixes; private readonly options; constructor(options: NamingHelperSettings, mainServiceName: string, namespaces?: Array<NamespaceWithAlias>); /** * The prefix used to reference model or enum types in this schema. * * @returns service prefix */ includesServicePrefix(name: string): boolean; /** * The OData service name as it was found and is used in metadata file. * * @returns */ getODataServiceName(): string; getFileNames(): { model: string; qObject: string; service: string; }; private getFileName; getFileNameService(name: string): string; stripServicePrefix(token: string): string; getNameAndServicePrefix(token: string): [string, string | undefined]; private namingFunction; private getName; private getModelNamingStrategy; private getModelPropNamingStrategy; private getQObjectNamingStrategy; private getQObjectPropNamingStrategy; private getOperationNamingStrategy; getModelName(name: string): string; getModelPropName(name: string): string; getEnumName(name: string): string; getEditableModelName(name: string): string; getIdModelName(name: string): string; getOperationParamsModelName(operationName: string, boundEntity?: string): string; getQName(name: string): string; getQBaseName(name: string): string; getQPropName(name: string): string; getQIdFunctionName(name: string): string; getQFunctionName(operationName: string, boundEntity?: string): string; getQActionName(operationName: string, boundEntity?: string): string; getMainServiceName(): string; getServiceName: (name: string) => string; getCollectionServiceName: (name: string) => string; private getPrefixedName; getFunctionName(operationName: string): string; getActionName(operationName: string): string; getRelatedServiceGetter(name: string): string; getPrivatePropName: (name: string) => string; getFolderPath(namespace: string, name: string): string; }