parent
a14b494f1d
commit
6f2406bfb7
@ -1,18 +1,44 @@ |
|||||||
import type { ConnectedPlugin } from "@ldo/connected"; |
import type { ConnectedContext, ConnectedPlugin } from "@ldo/connected"; |
||||||
import type { NextGraphUri } from "./types"; |
import type { NextGraphUri } from "./types"; |
||||||
import type { NextGraphResource } from "./resources/NextGraphResource"; |
import type { NextGraphResource } from "./resources/NextGraphResource"; |
||||||
|
|
||||||
export interface NextGraphConnectedPlugin extends ConnectedPlugin { |
export interface NextGraphConnectedContext { |
||||||
name: "nextGraph"; |
sessionId?: string; |
||||||
getResource(uri: NextGraphUri): NextGraphResource; |
|
||||||
context: { |
|
||||||
sessionId: string; |
|
||||||
}; |
|
||||||
} |
} |
||||||
|
export interface NextGraphConnectedPlugin |
||||||
|
extends ConnectedPlugin< |
||||||
|
"nextgraph", |
||||||
|
NextGraphUri, |
||||||
|
NextGraphResource, |
||||||
|
NextGraphConnectedContext |
||||||
|
> { |
||||||
|
name: "nextgraph"; |
||||||
|
getResource: ( |
||||||
|
uri: NextGraphUri, |
||||||
|
context: ConnectedContext<this[]>, |
||||||
|
) => NextGraphResource; |
||||||
|
createResource(context: ConnectedContext<this[]>): Promise<NextGraphResource>; |
||||||
|
} |
||||||
|
|
||||||
|
export const nextgGraphConnectedPlugin: NextGraphConnectedPlugin = { |
||||||
|
name: "nextgraph", |
||||||
|
|
||||||
|
getResource: function (_uri: NextGraphUri): NextGraphResource { |
||||||
|
throw new Error("Function not implemented."); |
||||||
|
}, |
||||||
|
|
||||||
|
createResource: function (): Promise<NextGraphResource> { |
||||||
|
throw new Error("Function not implemented."); |
||||||
|
}, |
||||||
|
|
||||||
|
isUriValid: function (uri: string): uri is NextGraphUri { |
||||||
|
throw new Error("Function not implemented."); |
||||||
|
}, |
||||||
|
|
||||||
export const nextGraphConnectedPlugin: NextGraphConnectedPlugin = { |
initialContext: { |
||||||
name: "nextGraph", |
sessionId: undefined, |
||||||
getResource(_uri: NextGraphUri): NextGraphResource { |
|
||||||
throw new Error("Not Implemented"); |
|
||||||
}, |
}, |
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
|
// @ts-ignore "Types" only exists for the typing system
|
||||||
|
types: {}, |
||||||
}; |
}; |
||||||
|
Loading…
Reference in new issue