@tpluscode/rdfine
Version:
RDF/JS idiomatic, native, effective
23 lines (22 loc) • 1.13 kB
TypeScript
import type { Term } from '@rdfjs/types';
import type { RdfResourceCore } from '../../../RdfResource.js';
import { EdgeTraversalFactory, PropRef } from '../../path.js';
import literalPropertyDecorator from '../property/literal.js';
import resourcePropertyDecorator from '../property/resource.js';
import { ObjectOrFactory, PropertyReturnKind, ArrayOrSingle } from './decoratorFactory.js';
export type { PropertyMeta } from './decoratorFactory.js';
export interface AccessorOptions {
values?: PropertyReturnKind | PropertyReturnKind[];
path?: ArrayOrSingle<PropRef | EdgeTraversalFactory>;
strict?: true;
subjectFromAllGraphs?: true;
filter?: (pointer: Term) => boolean;
}
interface TermOptions<TSelf> {
initial?: ObjectOrFactory<TSelf, Term, Term>;
}
export declare function property<R extends RdfResourceCore<any>>(options?: AccessorOptions & TermOptions<R>): (protoOrDescriptor: RdfResourceCore<any> | import("../index.js").ClassElement, name?: PropertyKey) => any;
export declare namespace property {
var literal: typeof literalPropertyDecorator;
var resource: typeof resourcePropertyDecorator;
}