sparnatural
Version:
Visual client-side SPARQL query builder and knowledge graph exploration tool
50 lines (49 loc) • 1.64 kB
TypeScript
import { SelectedVal } from "../SelectedVal";
import { HTMLComponent } from "../HtmlComponent";
import LoadingSpinner from "./LoadingSpinner";
import { Term } from "@rdfjs/types/data-model";
export declare enum ValueRepetition {
SINGLE = 0,
MULTIPLE = 1
}
export interface WidgetValue {
value: {
label: string;
};
key: () => string;
}
/**
* Generic RDFTerm value structure, either an IRI or a Literal with lang or datatype
*/
export declare class RDFTerm {
type: string;
value: string;
"xml:lang"?: string;
datatype?: string;
constructor(term: Term);
}
export declare class RdfTermValue implements WidgetValue {
value: {
label: string;
rdfTerm: RDFTerm;
};
key(): string;
constructor(v: RdfTermValue["value"]);
}
export declare abstract class AbstractWidget extends HTMLComponent {
valueRepetition: ValueRepetition;
startClassVal: SelectedVal;
objectPropVal: SelectedVal;
endClassVal: SelectedVal;
protected blockStartTriple: boolean;
protected blockObjectPropTriple: boolean;
protected blockEndTriple: boolean;
protected spinner: LoadingSpinner;
constructor(baseCssClass: string, parentComponent: HTMLComponent, widgetHTML: JQuery<HTMLElement>, startClassVal: SelectedVal, objectPropVal: SelectedVal, endClassVal: SelectedVal, valueRepetition: ValueRepetition);
render(): this;
abstract parseInput(value: WidgetValue["value"]): WidgetValue;
triggerRenderWidgetVal(widgetValue: WidgetValue | WidgetValue[]): void;
disableWidget(): void;
enableWidget(): void;
toggleSpinner(message?: string): void;
}