1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 | import { Thing, SolidDataset, UrlString, Url, getBoolean, getDatetime, getDecimal, getInteger, getUrl, getStringNoLocale, getStringWithLocale, getBooleanAll, getDatetimeAll, getDecimalAll, getIntegerAll, getStringNoLocaleAll, getStringWithLocaleAll, getUrlAll } from "@inrupt/solid-client";
|
22 | export declare type CommonProperties = {
|
23 | thing?: Thing;
|
24 | solidDataset?: SolidDataset;
|
25 | property?: Url | UrlString;
|
26 | properties?: Url[] | UrlString[];
|
27 | edit?: boolean;
|
28 | autosave?: boolean;
|
29 | onSave?: (savedDataset?: SolidDataset, savedThing?: Thing) => void;
|
30 | onError?: (error: Error) => void;
|
31 | };
|
32 | export declare const overwriteFile: (src: string, file: File, input: EventTarget & HTMLInputElement, fetch: ((input: RequestInfo | URL, init?: RequestInit | undefined) => Promise<Response>) & typeof fetch, maxSize?: number, onSave?: () => void, onError?: ((error: Error) => void) | undefined) => Promise<string | null>;
|
33 | export declare const retrieveFile: (src: string, fetch: ((input: RequestInfo | URL, init?: RequestInit | undefined) => Promise<Response>) & typeof fetch) => Promise<Blob>;
|
34 | export declare type DataType = "boolean" | "datetime" | "decimal" | "integer" | "string" | "url";
|
35 | export declare function getValueByType(type: "boolean", thing: Thing, property: UrlString | Url): ReturnType<typeof getBoolean>;
|
36 | export declare function getValueByType(type: "datetime", thing: Thing, property: UrlString | Url): ReturnType<typeof getDatetime>;
|
37 | export declare function getValueByType(type: "decimal", thing: Thing, property: UrlString | Url): ReturnType<typeof getDecimal>;
|
38 | export declare function getValueByType(type: "integer", thing: Thing, property: UrlString | Url): ReturnType<typeof getInteger>;
|
39 | export declare function getValueByType(type: "string", thing: Thing, property: UrlString | Url): ReturnType<typeof getStringNoLocale>;
|
40 | export declare function getValueByType(type: "string", thing: Thing, property: UrlString | Url, locale: string): ReturnType<typeof getStringWithLocale>;
|
41 | export declare function getValueByType(type: "string", thing: Thing, property: UrlString | Url): ReturnType<typeof getStringNoLocale>;
|
42 | export declare function getValueByType(type: "url", thing: Thing, property: UrlString | Url): ReturnType<typeof getUrl>;
|
43 | export declare function getValueByType(type: DataType, thing: Thing, property: UrlString | Url, locale?: string): string | boolean | number | Date | null;
|
44 | export declare function getValueByTypeAll(type: "boolean", thing: Thing, property: UrlString | Url): ReturnType<typeof getBooleanAll>;
|
45 | export declare function getValueByTypeAll(type: "datetime", thing: Thing, property: UrlString | Url): ReturnType<typeof getDatetimeAll>;
|
46 | export declare function getValueByTypeAll(type: "decimal", thing: Thing, property: UrlString | Url): ReturnType<typeof getDecimalAll>;
|
47 | export declare function getValueByTypeAll(type: "integer", thing: Thing, property: UrlString | Url): ReturnType<typeof getIntegerAll>;
|
48 | export declare function getValueByTypeAll(type: "string", thing: Thing, property: UrlString | Url): ReturnType<typeof getStringNoLocaleAll>;
|
49 | export declare function getValueByTypeAll(type: "string", thing: Thing, property: UrlString | Url, locale: string): ReturnType<typeof getStringWithLocaleAll>;
|
50 | export declare function getValueByTypeAll(type: "string", thing: Thing, property: UrlString | Url): ReturnType<typeof getStringNoLocaleAll>;
|
51 | export declare function getValueByTypeAll(type: "url", thing: Thing, property: UrlString | Url): ReturnType<typeof getUrlAll>;
|
52 | export declare function getValueByTypeAll(type: DataType, thing: Thing, property: UrlString | Url, locale?: string): Array<string | boolean | number | Date | null>;
|
53 | export declare function getPropertyForThing(propertySelector: typeof getValueByType | typeof getValueByTypeAll, type: DataType, thing: Thing, properties: Array<Url | UrlString>, locale?: string): Url | UrlString | undefined;
|
54 | export declare type UseProperty = {
|
55 | dataset?: SolidDataset;
|
56 | thing?: Thing;
|
57 | error?: Error;
|
58 | property: Url | UrlString;
|
59 | value: string | boolean | number | Date | null;
|
60 | setDataset: (dataset: SolidDataset) => void;
|
61 | setThing: (thing: Thing) => void;
|
62 | };
|
63 | export declare type UsePropertyProps = {
|
64 | thing?: Thing;
|
65 | dataset?: SolidDataset;
|
66 | property?: Url | UrlString;
|
67 | properties?: Url[] | UrlString[];
|
68 | type: DataType;
|
69 | locale?: string;
|
70 | };
|
71 | export declare function useProperty(props: UsePropertyProps): UseProperty;
|
72 | export declare function useDatetimeBrowserSupport(): boolean | null;
|
73 | export declare function updateDataset(datasetUrl: string | Url, setDataset: (dataset: SolidDataset) => void): Promise<void>;
|
74 |
|
\ | No newline at end of file |