Commit c19a3582 authored by Fabien Amarger's avatar Fabien Amarger

feat: [datafetcher] Add datafetcher to the simplerender signature

This datafetcher implement the fetchDataFromURI method which fetch
the data for the URI and format the return, depending on the respFormat
parameter.

By the way, add the nodeId parameter, which is the node id in which
the view must render the result.
parent 213cc8fb997
Pipeline #13861 passed with stages
in 2 minutes
......@@ -53,7 +53,12 @@ export interface ViewRendering {
suggestedResources?: Resource[];
}
export type FetchDataFromURIFunction = (uri: string, respFormat?: {[key: string]: string}) => Promise<{[key: string]: string}>;
export type DataFetcher = {
fetchDataFromURI: (
uri: string,
respFormat?: { [key: string]: string }
) => Promise<{ [key: string]: string }>;
};
/**
* The implementation of a view
......@@ -84,7 +89,12 @@ export interface ViewImplementation {
target: Resource
): ViewRendering;
simpleRender?: (context: $rdf.Formula, target: string, fetchDataFromURI?: FetchDataFromURIFunction) => Element;
simpleRender?: (
nodeId: string,
context: $rdf.Formula,
target: string,
dataFetcher?: DataFetcher
) => Element;
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment