defineExtension
defineExtension<
E>(extension):E
Identity function with a precise parameter type, so export default defineExtension({ ... })
gets full editor autocomplete and type-checking with no extra annotation. It returns
the object’s own type, so tests can call extension.update(ctx) or
extension.tools.lookup.run(...) directly.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
E extends Extension |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
extension |
E |
Returns
Section titled “Returns”E