Skip to content

Commit

Permalink
$mol_service_plugin moved to $ namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
zerkalica committed Oct 30, 2024
1 parent 21da91e commit cbcef3f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion service/host/host.web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ namespace $ {
worker.addEventListener( 'statechange', this.state_change.bind(this, worker))
}

static plugins = [] as (typeof $mol_service.$mol_service_plugin)[]
static plugins = [] as (typeof $mol_service_plugin)[]

static state_change(worker: ServiceWorker) {
for (const plugin of this.plugins) {
Expand Down
13 changes: 13 additions & 0 deletions service/plugin/plugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace $ {
export class $mol_service_plugin extends $mol_object {
static init() {}
static before_install() {}
static install() { return null as undefined | null | Promise<unknown> }
static activate() { return null as undefined | null | Promise<unknown> }
static state_change() {}
static message_data(data: {}) { return null as null | undefined | Promise<unknown> }

static blocked(res: Request) { return false }
static modify(res: Request) { return null as null | Response | PromiseLike<Response> }
}
}
12 changes: 1 addition & 11 deletions service/service.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
namespace $.$mol_service {
export class $mol_service_plugin extends $mol_object {
static init() {}
static before_install() {}
static install() { return null as undefined | null | Promise<unknown> }
static activate() { return null as undefined | null | Promise<unknown> }
static state_change() {}
static message_data(data: {}) { return null as null | undefined | Promise<unknown> }

static blocked(res: Request) { return false }
static modify(res: Request) { return null as null | Response | PromiseLike<Response> }
}
let _
}

0 comments on commit cbcef3f

Please sign in to comment.