@logilab/sparqlexplorer 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +661 -0
- package/README.md +73 -0
- package/build/src/lib/App.d.ts +6 -0
- package/build/src/lib/components/ClassList.d.ts +9 -0
- package/build/src/lib/components/EndpointForm.d.ts +1 -0
- package/build/src/lib/components/GraphSelector.d.ts +1 -0
- package/build/src/lib/components/HomePage.d.ts +1 -0
- package/build/src/lib/components/SearchPage.d.ts +1 -0
- package/build/src/lib/components/UriPage.d.ts +1 -0
- package/build/src/lib/components/UtilsComponents.d.ts +11 -0
- package/build/src/lib/components/ViewSelector.d.ts +2 -0
- package/build/src/lib/components/Yasgui.d.ts +6 -0
- package/build/src/lib/components/YasrTableResults.d.ts +55 -0
- package/build/src/lib/components/layout/DrawerContent.d.ts +4 -0
- package/build/src/lib/components/layout/Footer.d.ts +1 -0
- package/build/src/lib/components/layout/Layout.d.ts +2 -0
- package/build/src/lib/components/layout/Navbar.d.ts +4 -0
- package/build/src/lib/components/uri/URIDefaultView.d.ts +6 -0
- package/build/src/lib/components/uri/URIWithSelectedView.d.ts +7 -0
- package/build/src/lib/context/AuthContext.d.ts +11 -0
- package/build/src/lib/context/ConfigContext.d.ts +15 -0
- package/build/src/lib/context/ViewsContext.d.ts +14 -0
- package/build/src/lib/hooks/useClasses.d.ts +6 -0
- package/build/src/lib/hooks/useGraphs.d.ts +8 -0
- package/build/src/lib/hooks/useNavigateWithParams.d.ts +5 -0
- package/build/src/lib/hooks/useParams.d.ts +1 -0
- package/build/src/lib/hooks/useURIData.d.ts +21 -0
- package/build/src/lib/hooks/useURILink.d.ts +1 -0
- package/build/src/lib/index.d.ts +8 -0
- package/build/src/lib/public-path.d.ts +1 -0
- package/build/src/lib/routes/Home.d.ts +1 -0
- package/build/src/lib/routes/Search.d.ts +1 -0
- package/build/src/lib/routes/Uri.d.ts +1 -0
- package/build/src/lib/routes/Yasgui.d.ts +1 -0
- package/build/src/lib/setupTests.d.ts +1 -0
- package/build/src/lib/utils/getIconFromURI.d.ts +3 -0
- package/build/src/lib/utils/utils.d.ts +24 -0
- package/build/src/lib/yasgui-utils/Storage.d.ts +16 -0
- package/build/src/lib/yasgui-utils/index.d.ts +16 -0
- package/build/static/js/lib.js +285 -0
- package/build/static/js/lib.js.LICENSE.txt +71 -0
- package/build/static/js/lib.js.map +1 -0
- package/package.json +73 -0
- package/src/app/index.css +23 -0
- package/src/app/index.tsx +28 -0
- package/src/app/templates/constants.js +1 -0
- package/src/app/templates/index.hbs +18 -0
- package/src/lib/App.css +83 -0
- package/src/lib/App.tsx +31 -0
- package/src/lib/components/ClassList.tsx +173 -0
- package/src/lib/components/EndpointForm.tsx +126 -0
- package/src/lib/components/GraphSelector.tsx +114 -0
- package/src/lib/components/HomePage.tsx +51 -0
- package/src/lib/components/SearchPage.tsx +211 -0
- package/src/lib/components/UriPage.tsx +158 -0
- package/src/lib/components/UtilsComponents.tsx +54 -0
- package/src/lib/components/ViewSelector.css +22 -0
- package/src/lib/components/ViewSelector.tsx +78 -0
- package/src/lib/components/Yasgui.tsx +127 -0
- package/src/lib/components/YasrTableResults.ts +529 -0
- package/src/lib/components/layout/DrawerContent.tsx +55 -0
- package/src/lib/components/layout/Footer.tsx +32 -0
- package/src/lib/components/layout/Layout.tsx +103 -0
- package/src/lib/components/layout/Navbar.tsx +231 -0
- package/src/lib/components/uri/URIDefaultView.tsx +392 -0
- package/src/lib/components/uri/URIWithSelectedView.tsx +31 -0
- package/src/lib/context/AuthContext.tsx +32 -0
- package/src/lib/context/ConfigContext.tsx +50 -0
- package/src/lib/context/ViewsContext.tsx +53 -0
- package/src/lib/hooks/useClasses.ts +48 -0
- package/src/lib/hooks/useGraphs.ts +67 -0
- package/src/lib/hooks/useNavigateWithParams.tsx +97 -0
- package/src/lib/hooks/useParams.tsx +8 -0
- package/src/lib/hooks/useURIData.ts +180 -0
- package/src/lib/hooks/useURILink.ts +7 -0
- package/src/lib/index.tsx +9 -0
- package/src/lib/public-path.ts +3 -0
- package/src/lib/routes/Home.tsx +13 -0
- package/src/lib/routes/Search.tsx +13 -0
- package/src/lib/routes/Uri.tsx +10 -0
- package/src/lib/routes/Yasgui.tsx +13 -0
- package/src/lib/setupTests.ts +5 -0
- package/src/lib/types.d.ts +6 -0
- package/src/lib/utils/getIconFromURI.ts +32 -0
- package/src/lib/utils/prefixInverted.json +2445 -0
- package/src/lib/utils/utils.ts +131 -0
- package/src/lib/yasgui-utils/Storage.ts +117 -0
- package/src/lib/yasgui-utils/index.ts +66 -0
package/README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# SparqlExplorer
|
|
2
|
+
|
|
3
|
+
SparqlExplorer is a web application you can use to explore the content of any SPARQL endpoint without writing SPARQL queries.
|
|
4
|
+
|
|
5
|
+
The stable version is available at [sparqlexplorer.app](https://sparqlexplorer.app). The CI deploys there the latest version with a tag.
|
|
6
|
+
|
|
7
|
+
The unstable version (public head of this repository) is automatically deployed on
|
|
8
|
+
[open-source.pages.logilab.fr/SemWeb/sparqlexplorer/](https://open-source.pages.logilab.fr/SemWeb/sparqlexplorer/) by the CI.
|
|
9
|
+
|
|
10
|
+
## Interface walkthrough
|
|
11
|
+
|
|
12
|
+
In this example we use data from data.culture hosted at [data.idref.fr/sparql](https://data.idref.fr/sparql).
|
|
13
|
+
|
|
14
|
+
The first step is to enter the sparql endpoint:
|
|
15
|
+
|
|
16
|
+
<img alt='Input a Sparql endpoint URL' src='./img/entry_sparql.png' width='500px'/>
|
|
17
|
+
|
|
18
|
+
When clicking on "explore" SparqlExplorer will display a list of all the classes available on the SPARQL endpoint with their number of instances. This list can be filtered thanks to the filter bar.
|
|
19
|
+
|
|
20
|
+
<img alt='Class list' src='./img/classes.png' width='500px'/>
|
|
21
|
+
|
|
22
|
+
If we click on a Class, we obtain the triples in which the URL is the subject or the object.
|
|
23
|
+
This tabular view is the _default view_. Every URL is clickable and you can navigate from URL to URL keeping the same view.
|
|
24
|
+
|
|
25
|
+
<img alt='Default view' src='./img/default_view.png' width='750px'/>
|
|
26
|
+
|
|
27
|
+
### Using custom views
|
|
28
|
+
|
|
29
|
+
While the default view will work on any vocabulary it may not be the most user friendly.
|
|
30
|
+
Sparql explorer comes with a set of custom views for specific vocabularies such as SKOS, FOAF and others.
|
|
31
|
+
|
|
32
|
+
When viewing a URL description, the left burger menu lists the available views.
|
|
33
|
+
The current view is highlighted in blue and views not applicable to the current URI description are faded out.
|
|
34
|
+
<img alt='Default view' src='./img/burger_view.png' width='750px'/>
|
|
35
|
+
|
|
36
|
+
An automatic mode is available (check the "Automatic" checkbox) to select an applicable custom view automatically.
|
|
37
|
+
Each custom view will send a SPARQL query to check if it is compatible with the current URI.
|
|
38
|
+
The selected view will be displayed in the burger menu.
|
|
39
|
+
<img alt='Automatic view' src='./img/automatic.png' width='750px'/>
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
If no view is suited for the URL description, a pop up will appear and the view will fallback to default.
|
|
43
|
+
<img alt='Wrong view' src='./img/wrong_view.png' width='750px'/>
|
|
44
|
+
|
|
45
|
+
## Running SparqlExplorer locally
|
|
46
|
+
|
|
47
|
+
To run Sparql Explorer, clone with Mercurial and install the npm project.
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
hg clone https://forge.extranet.logilab.fr/open-source/SemWeb/sparqlexplorer
|
|
51
|
+
npm install
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Then you can start the development server on your http://localhost:3000 with
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
npm run serve
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
To edit custom views, please refer to the [readme in the generic-views repo](https://forge.extranet.logilab.fr/open-source/SemWeb/generic-views).
|
|
61
|
+
|
|
62
|
+
## Deployment
|
|
63
|
+
|
|
64
|
+
Test the [unstable version](https://open-source.pages.logilab.fr/SemWeb/sparqlexplorer/) then increment version number
|
|
65
|
+
and publish a tag to have it deployed at [sparqlexplorer.app](https://sparqlexplorer.app).
|
|
66
|
+
|
|
67
|
+
## Contributing
|
|
68
|
+
|
|
69
|
+
SparqlExplorer is licensed under [AGPLv3](./LICENSE), all contributions are welcome!
|
|
70
|
+
|
|
71
|
+
As the project is on the Logilab code hosting platform, you will need an account to create pull requests and open issues.
|
|
72
|
+
|
|
73
|
+
Please reach us on our [public matrix channel](https://matrix.to/#/#public:matrix.logilab.org) or via email at [contact@logilab.fr](mailto:contact@logilab.fr) if you want to contribute.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const EndpointForm: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function GraphSelector(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function HomePage(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function SearchPage(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function UriPage(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type RDFNode } from "../utils/utils";
|
|
2
|
+
export declare function Loading(): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function AlertError({ error }: {
|
|
4
|
+
error: string;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function NoResults(): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function URILink({ node, focusUri, label, }: {
|
|
8
|
+
node: RDFNode;
|
|
9
|
+
focusUri?: string;
|
|
10
|
+
label?: string;
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import "@logilab/yasgui/build/yasgui.min.css";
|
|
2
|
+
export interface YasguiModuleProps {
|
|
3
|
+
endpoint: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function YasguiModule({ endpoint }: YasguiModuleProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function YasguiPage(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type Yasr from "@logilab/yasr";
|
|
2
|
+
import type { DownloadInfo, Plugin } from "@logilab/yasr";
|
|
3
|
+
import { type Config } from "datatables.net";
|
|
4
|
+
import "@logilab/yasr/src/plugins/table/index.scss";
|
|
5
|
+
import "datatables.net-dt/css/jquery.dataTables.css";
|
|
6
|
+
export interface PluginConfig {
|
|
7
|
+
openIriInNewWindow: boolean;
|
|
8
|
+
tableConfig: Config;
|
|
9
|
+
urlParams: string;
|
|
10
|
+
}
|
|
11
|
+
export interface PersistentConfig {
|
|
12
|
+
pageSize?: number;
|
|
13
|
+
compact?: boolean;
|
|
14
|
+
isEllipsed?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare class YasrTableResults implements Plugin<PluginConfig> {
|
|
17
|
+
private config;
|
|
18
|
+
private persistentConfig;
|
|
19
|
+
private yasr;
|
|
20
|
+
private tableControls;
|
|
21
|
+
private tableEl;
|
|
22
|
+
private dataTable;
|
|
23
|
+
private tableFilterField;
|
|
24
|
+
private tableSizeField;
|
|
25
|
+
private tableCompactSwitch;
|
|
26
|
+
private tableEllipseSwitch;
|
|
27
|
+
private tableResizer;
|
|
28
|
+
helpReference: string;
|
|
29
|
+
label: string;
|
|
30
|
+
priority: number;
|
|
31
|
+
getIcon(): HTMLDivElement;
|
|
32
|
+
constructor(yasr: Yasr);
|
|
33
|
+
static defaults: PluginConfig;
|
|
34
|
+
private getRows;
|
|
35
|
+
private getUriLinkFromBinding;
|
|
36
|
+
private getCellContent;
|
|
37
|
+
private formatLiteral;
|
|
38
|
+
private getColumns;
|
|
39
|
+
private getSizeFirstColumn;
|
|
40
|
+
draw(persistentConfig: PersistentConfig): void;
|
|
41
|
+
private setEllipsisHandlers;
|
|
42
|
+
private handleTableSearch;
|
|
43
|
+
private handleTableSizeSelect;
|
|
44
|
+
private handleSetCompactToggle;
|
|
45
|
+
private handleSetEllipsisToggle;
|
|
46
|
+
/**
|
|
47
|
+
* Draws controls on each update
|
|
48
|
+
*/
|
|
49
|
+
drawControls(): void;
|
|
50
|
+
download(filename?: string): DownloadInfo;
|
|
51
|
+
canHandleResults(): boolean;
|
|
52
|
+
private removeControls;
|
|
53
|
+
private destroyResizer;
|
|
54
|
+
destroy(): void;
|
|
55
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Footer(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SparqlViewConfig } from "@logilab/sparqlexplorer-views";
|
|
2
|
+
export interface URIWithSelectedViewProps {
|
|
3
|
+
endpoint: string;
|
|
4
|
+
uri: string;
|
|
5
|
+
viewWrapper: SparqlViewConfig;
|
|
6
|
+
}
|
|
7
|
+
export declare function URIWithSelectedView({ endpoint, uri, viewWrapper, }: URIWithSelectedViewProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { BasicAuth } from "@logilab/sparqlutils";
|
|
2
|
+
import { type PropsWithChildren } from "react";
|
|
3
|
+
export type AuthContextType = {
|
|
4
|
+
auth: BasicAuth | undefined;
|
|
5
|
+
setAuth: (auth: BasicAuth | undefined) => void;
|
|
6
|
+
};
|
|
7
|
+
export declare function AuthProvider({ children }: PropsWithChildren): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function useAuth(): {
|
|
9
|
+
auth: BasicAuth | undefined;
|
|
10
|
+
setAuth: (auth: BasicAuth | undefined) => void;
|
|
11
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type PropsWithChildren } from "react";
|
|
2
|
+
export type SparqlExplorerConfig = {
|
|
3
|
+
endpoint: string | null;
|
|
4
|
+
canEditEndpoint: boolean;
|
|
5
|
+
view: string | null;
|
|
6
|
+
selectedGraphs: string[];
|
|
7
|
+
};
|
|
8
|
+
export declare function ConfigProvider({ children, config, }: PropsWithChildren<{
|
|
9
|
+
config: SparqlExplorerConfig;
|
|
10
|
+
}>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function useConfig(): SparqlExplorerConfig;
|
|
12
|
+
export declare function useEndpoint(): string | null;
|
|
13
|
+
export declare function useView(): string | null;
|
|
14
|
+
export declare function useCanEditEndpoint(): boolean;
|
|
15
|
+
export declare function useSelectedGraphs(): string[];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { SparqlViewConfig } from "@logilab/sparqlexplorer-views";
|
|
2
|
+
import { type PropsWithChildren, type Dispatch, type SetStateAction } from "react";
|
|
3
|
+
type ViewsProps = {
|
|
4
|
+
views: SparqlViewConfig[];
|
|
5
|
+
};
|
|
6
|
+
export declare const ViewsContext: import("react").Context<{
|
|
7
|
+
views: SparqlViewConfig[];
|
|
8
|
+
selectedView?: SparqlViewConfig;
|
|
9
|
+
setSelectedView: Dispatch<SetStateAction<SparqlViewConfig | undefined>>;
|
|
10
|
+
applicableViews?: SparqlViewConfig[];
|
|
11
|
+
setApplicableViews: Dispatch<SetStateAction<SparqlViewConfig[] | undefined>>;
|
|
12
|
+
}>;
|
|
13
|
+
export declare function ViewsProvider({ views, children, }: PropsWithChildren<ViewsProps>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function useNavigateWithParams(): (pathname: string, newParams?: Record<string, string | null>, replace?: boolean) => void;
|
|
2
|
+
export declare function useSearchParamsString(): (newParams?: Record<string, string | null>) => string;
|
|
3
|
+
export declare function useChangeView(): (view: string | null) => void;
|
|
4
|
+
export declare function useAddGraph(): (graph: string) => void;
|
|
5
|
+
export declare function useRemoveGraph(): (graph: string) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useParam(param: string): string | null;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type Label, type RDFNode } from "../utils/utils";
|
|
2
|
+
export interface ITriples {
|
|
3
|
+
subject: RDFNode;
|
|
4
|
+
predicate: RDFNode;
|
|
5
|
+
object: RDFNode;
|
|
6
|
+
graph: RDFNode;
|
|
7
|
+
}
|
|
8
|
+
export declare function useURIData({ endpoint, uri, graphs, search, page, perPage, }: {
|
|
9
|
+
endpoint: string;
|
|
10
|
+
uri: string;
|
|
11
|
+
graphs: string[];
|
|
12
|
+
search: string;
|
|
13
|
+
page: number;
|
|
14
|
+
perPage: number;
|
|
15
|
+
}): {
|
|
16
|
+
triples: ITriples[];
|
|
17
|
+
total: number;
|
|
18
|
+
labels: Label[];
|
|
19
|
+
error: string | null;
|
|
20
|
+
isLoaded: boolean;
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useURILink(uri: string): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./App";
|
|
2
|
+
export * from "./utils/utils";
|
|
3
|
+
export * from "./context/ViewsContext";
|
|
4
|
+
export * from "./context/AuthContext";
|
|
5
|
+
export * from "./context/ConfigContext";
|
|
6
|
+
export * from "./utils/getIconFromURI";
|
|
7
|
+
import App from "./App";
|
|
8
|
+
export default App;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare var SPARQL_ENDPOINT: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Home(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Search(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Uri(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Yasgui(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "@testing-library/jest-dom/extend-expect";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type SparqlViewConfig } from "@logilab/sparqlexplorer-views";
|
|
2
|
+
import type { SparqlAuth } from "@logilab/sparqlutils";
|
|
3
|
+
export interface RDFNode {
|
|
4
|
+
type: "uri" | "bnode" | "literal";
|
|
5
|
+
value: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function stringIncludes(a: string, b: string): boolean;
|
|
8
|
+
export declare function computeRedirect(uri: string, params: string): string;
|
|
9
|
+
export declare function prefixedNameFromUri(uri: string): string;
|
|
10
|
+
export declare function getSavedEndpoints(): Array<string>;
|
|
11
|
+
export declare function addToSavedEndpoints(value: string): void;
|
|
12
|
+
export declare function getApplicableViews(uri: string, endpoint: string, auth?: SparqlAuth): Promise<Array<SparqlViewConfig>>;
|
|
13
|
+
export declare const DEFAUT_VIEW_NAME = "Default view";
|
|
14
|
+
export declare function isDefaultView(viewName: string | null): viewName is "Default view";
|
|
15
|
+
export declare function getLabelSparqlClause(uri?: string, onlyRdfsLabel?: boolean): string;
|
|
16
|
+
export interface Label {
|
|
17
|
+
value: string;
|
|
18
|
+
lang: string | null;
|
|
19
|
+
}
|
|
20
|
+
export interface UriAndLabels {
|
|
21
|
+
uri: string;
|
|
22
|
+
labels: Label[];
|
|
23
|
+
}
|
|
24
|
+
export declare function getBestLabel(instance: UriAndLabels): string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface ItemWrapper<V = Record<string, unknown>> {
|
|
2
|
+
exp: number;
|
|
3
|
+
val: V;
|
|
4
|
+
namespace: string;
|
|
5
|
+
time: number;
|
|
6
|
+
}
|
|
7
|
+
export default class Storage {
|
|
8
|
+
private namespace;
|
|
9
|
+
constructor(namespace: string);
|
|
10
|
+
set<V = Record<string, unknown>>(key: string | undefined, val: any, expInSeconds: number, onQuotaExceeded: (e: any) => void): void;
|
|
11
|
+
remove(key: string): void;
|
|
12
|
+
removeExpiredKeys(): void;
|
|
13
|
+
removeAll(): void;
|
|
14
|
+
removeNamespace(): void;
|
|
15
|
+
get<V>(key?: string): V | undefined;
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare function drawSvgStringAsElement(svgString: string): HTMLDivElement;
|
|
2
|
+
export interface FaIcon {
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
svgPathData: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Draws font fontawesome icon as svg. This is a lot more lightweight then the option that is offered by fontawesome
|
|
9
|
+
* @param faIcon
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
export declare function drawFontAwesomeIconAsSvg(faIcon: FaIcon): string;
|
|
13
|
+
export declare function hasClass(el: Element | undefined, className: string): boolean | undefined;
|
|
14
|
+
export declare function addClass(el: Element | undefined | null, ...classNames: string[]): void;
|
|
15
|
+
export declare function removeClass(el: Element | undefined | null, className: string): void;
|
|
16
|
+
export declare function getAsValue<E, A>(valueOrFn: E | ((arg: A) => E), arg: A): E;
|