Added LinksGrid components, updated documentation
This commit is contained in:
@@ -31,12 +31,14 @@ const asyncDatabaseRead = async <Type>(
|
||||
callback: asyncDatabaseRowsCallbackFunction
|
||||
): Promise<Type> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
database.all(sqlQuery, (error: Error, rows: any) => {
|
||||
if (error !== null) {
|
||||
reject(error);
|
||||
} else {
|
||||
resolve(callback(rows));
|
||||
}
|
||||
database.serialize(() => {
|
||||
database.all(sqlQuery, (error: Error, rows: any) => {
|
||||
if (error !== null) {
|
||||
reject(error);
|
||||
} else {
|
||||
resolve(callback(rows));
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
@@ -57,12 +59,14 @@ const asyncDatabaseWrite = async <Type>(
|
||||
callback: asyncDatabaseVoidCallbackFunction
|
||||
): Promise<Type> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
database.run(sqlQuery, (error: Error) => {
|
||||
if (error !== null) {
|
||||
reject(error);
|
||||
} else {
|
||||
resolve(callback());
|
||||
}
|
||||
database.serialize(() => {
|
||||
database.run(sqlQuery, (error: Error) => {
|
||||
if (error !== null) {
|
||||
reject(error);
|
||||
} else {
|
||||
resolve(callback());
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
33
utils/types/linksGrid.ts
Normal file
33
utils/types/linksGrid.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Types for LinksGrid component
|
||||
* @module utils/types/linksGrid
|
||||
*/
|
||||
|
||||
import type { LinkCardProperty } from "./linkCard";
|
||||
|
||||
/**
|
||||
* Interface that defines property for LinksGrid component
|
||||
* @property {Array<LinkCardProperty>} links Array of property of LinkCard components
|
||||
* @example
|
||||
* const linksList = [
|
||||
* {
|
||||
* title: "test 1",
|
||||
* description: "Test Page #1",
|
||||
* link: "/test/1",
|
||||
* imagePath: "/images/test-1.png",
|
||||
* },
|
||||
* ...
|
||||
* {
|
||||
* title: "test n",
|
||||
* description: "Test Page #n",
|
||||
* link: "/test/n",
|
||||
* imagePath: "/images/test-n.png",
|
||||
* },
|
||||
* ];
|
||||
* <LinksGrid :links="linksList" />
|
||||
*/
|
||||
interface LinksGridProperty {
|
||||
links: Array<LinkCardProperty>;
|
||||
}
|
||||
|
||||
export type { LinksGridProperty };
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Types for Slide component
|
||||
* @module utils/types/slide.ts
|
||||
* @module utils/types/slide
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user