Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const rules = {
'@stylistic/no-mixed-spaces-and-tabs': ['error', 'smart-tabs'],
'custom/space-unary-ops-with-exception': ['error', { words: true, nonwords: false }],
'@stylistic/no-multi-spaces': ['error', { exceptions: { 'VariableDeclarator': true } }],
'@stylistic/type-annotation-spacing': 'error',
};

export default defineConfig([
Expand Down
13 changes: 7 additions & 6 deletions extensions/api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type * as ExtensionControllerExports from './ExtensionController/src/Exte
declare global {
namespace Express {
interface Request {
services: { get: <T extends (keyof ServiceNameMap ) | (string & {})>(string: T)=> T extends keyof ServiceNameMap ? ServiceNameMap[T] : unknown }
services: { get: <T extends (keyof ServiceNameMap) | (string & {}) >(string: T) => T extends keyof ServiceNameMap ? ServiceNameMap[T] : unknown }
actor: Actor,
rawBody: Buffer,
/** @deprecated use actor instead */
Expand Down Expand Up @@ -68,11 +68,12 @@ interface ServiceNameMap {
}
interface Extension extends RouterMethods {
exports: Record<string, unknown>,
on<T extends unknown[]>(event: string, listener: (...args: T)=> void): void, // TODO DS: type events better
import(module:'core'): CoreRuntimeModule,
import(module:'fs'): FilesystemModule,
import(module:'extensionController'): typeof ExtensionControllerExports
import<T extends `service:${keyof ServiceNameMap}`| (string & {})>(module: T): T extends `service:${infer R extends keyof ServiceNameMap}`
on<T extends unknown[]>(event: string, listener: (...args: T) => void): void, // TODO DS: type events better
import(module: 'data'): { db: BaseDatabaseAccessService, kv: DBKVStore, cache: unknown }// TODO DS: type cache better
import(module: 'core'): CoreRuntimeModule,
import(module: 'fs'): FilesystemModule,
import(module: 'extensionController'): typeof ExtensionControllerExports
import<T extends `service:${keyof ServiceNameMap}` | (string & {})>(module: T): T extends `service:${infer R extends keyof ServiceNameMap}`
? ServiceNameMap[R]
: unknown;
}
Expand Down