UNPKG

schema-dts-gen

Version:

Generate TypeScript Definitions for Schema.org Schema

54 lines 1.8 kB
/** * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import ts from 'typescript'; import type { PropertySignature } from 'typescript'; import type { ClassMap } from './class.js'; import { Context } from './context.js'; import type { NamedNode, Quad } from 'n3'; /** * A "class" of properties, not associated with any particuar object. */ export declare class PropertyType { private readonly subject; private readonly types; private _comment?; private readonly _supersededBy; constructor(subject: NamedNode); get comment(): string | undefined; get deprecated(): boolean; add(value: Quad, classes: ClassMap): boolean; scalarTypeNode(): ts.TypeNode; } /** * A Property on a particular object. */ export declare class Property { readonly key: NamedNode; private readonly type; constructor(key: NamedNode, type: PropertyType); get deprecated(): boolean; private typeNode; toNode(context: Context, properties: { hasRole: boolean; }): PropertySignature; } export declare class TypeProperty { private readonly className; constructor(className: NamedNode); toNode(context: Context): ts.PropertySignature; readonly deprecated = false; } //# sourceMappingURL=property.d.ts.map