Sfoglia il codice sorgente

Separate project

Extract project from monorepo.
master
commit
f1019fe92d
6 ha cambiato i file con 65 aggiunte e 0 eliminazioni
  1. +2
    -0
      .npmignore
  2. +3
    -0
      README.md
  3. +11
    -0
      package.json
  4. +5
    -0
      src/plugin.ts
  5. +16
    -0
      src/storage.ts
  6. +28
    -0
      tsconfig.json

+ 2
- 0
.npmignore Vedi File

@@ -0,0 +1,2 @@
*.ts
tsconfig.json

+ 3
- 0
README.md Vedi File

@@ -0,0 +1,3 @@
# Zeichen - Core

Library for authoring Zeichen plugins and themes.

+ 11
- 0
package.json Vedi File

@@ -0,0 +1,11 @@
{
"name": "zeichen-core",
"description": "Library for authoring Zeichen plugins and themes.",
"version": "0.1.0",
"devDependencies": {
"typescript": "^4.0.3"
},
"scripts": {
"build": "tsc **/*.ts"
}
}

+ 5
- 0
src/plugin.ts Vedi File

@@ -0,0 +1,5 @@
export type State = {
currentUserId: string,
}

export type Plugin<T = {}> = (config: T) => (state: State) => void

+ 16
- 0
src/storage.ts Vedi File

@@ -0,0 +1,16 @@
export default interface Storage<T> {
queryItems(): Promise<T[]>
saveItem(item: T): Promise<void>
deleteItem(item: T): Promise<boolean>
}

export interface Collection<T> {
items: T[],
lastModifiedBy: string,
lastModifiedAt: Date,
}

export type Serializer<T = unknown> = (t: T) => string
export type Deserializer<T = unknown> = (s: string) => T

export class OutOfSyncError {}

+ 28
- 0
tsconfig.json Vedi File

@@ -0,0 +1,28 @@
{
"compilerOptions": {
"target": "es6",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"module": "esnext",
"moduleResolution": "node",
"declaration": true,
"declarationDir": "./dist",
"emitDeclarationOnly": true,
"sourceMap": true,
"strict": false
},
"exclude": [
"node_modules",
"**/*.test.ts"
],
"include": [
"**/*.ts"
]
}

Caricamento…
Annulla
Salva