mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-23 00:22:56 +01:00
Add repoTemplates and issueTemplates stores and types
cgen-bd92d45792654082b0f922a19efec799
This commit is contained in:
parent
110cca7f75
commit
ecf9f1b837
1 changed files with 20 additions and 0 deletions
|
|
@ -44,6 +44,20 @@ export interface FsHandleRecord {
|
||||||
handle: FileSystemDirectoryHandle;
|
handle: FileSystemDirectoryHandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface RepoTemplateRecord {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
fsHandleId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IssueTemplateRecord {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
title: string;
|
||||||
|
body: string;
|
||||||
|
labels: string[];
|
||||||
|
}
|
||||||
|
|
||||||
export async function openDB(): Promise<IDBDatabase> {
|
export async function openDB(): Promise<IDBDatabase> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const req = indexedDB.open(DB_NAME, DB_VERSION);
|
const req = indexedDB.open(DB_NAME, DB_VERSION);
|
||||||
|
|
@ -72,6 +86,12 @@ export async function openDB(): Promise<IDBDatabase> {
|
||||||
if (!db.objectStoreNames.contains("settings")) {
|
if (!db.objectStoreNames.contains("settings")) {
|
||||||
db.createObjectStore("settings", { keyPath: "id" });
|
db.createObjectStore("settings", { keyPath: "id" });
|
||||||
}
|
}
|
||||||
|
if (!db.objectStoreNames.contains("repoTemplates")) {
|
||||||
|
db.createObjectStore("repoTemplates", { keyPath: "id" });
|
||||||
|
}
|
||||||
|
if (!db.objectStoreNames.contains("issueTemplates")) {
|
||||||
|
db.createObjectStore("issueTemplates", { keyPath: "id" });
|
||||||
|
}
|
||||||
};
|
};
|
||||||
req.onsuccess = () => resolve(req.result);
|
req.onsuccess = () => resolve(req.result);
|
||||||
req.onerror = () => reject(req.error);
|
req.onerror = () => reject(req.error);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue