fixed GetHookData
This commit is contained in:
parent
7a628c0a55
commit
8f988cf2ac
9
index.d.ts
vendored
9
index.d.ts
vendored
@ -18,7 +18,7 @@ export interface ReadCollectionOptions {
|
||||
sort?: string[]
|
||||
}
|
||||
|
||||
interface GetHookData {
|
||||
interface GetHookGetOnlyData {
|
||||
/**
|
||||
* true if only one document was requested via /COLLECTION/ID
|
||||
*/
|
||||
@ -27,6 +27,9 @@ interface GetHookData {
|
||||
* get list of documents (only valid after stage "read" in "get" hook)
|
||||
*/
|
||||
results(): CollectionDocument[]
|
||||
}
|
||||
|
||||
interface GetHookData {
|
||||
/**
|
||||
* filter map only valid for "get" hooks
|
||||
*/
|
||||
@ -60,7 +63,7 @@ interface PostHookData {
|
||||
data?: CollectionDocument
|
||||
}
|
||||
|
||||
export interface HookContext extends GetHookData, PostHookData {
|
||||
export interface HookContext extends GetHookData, GetHookGetOnlyData, PostHookData {
|
||||
request(): {
|
||||
method: string
|
||||
remoteAddr: string
|
||||
@ -375,7 +378,7 @@ export interface HookException {
|
||||
|
||||
export interface HookResponse extends GetHookData, PostHookData {
|
||||
data?: CollectionDocument
|
||||
results: any
|
||||
results?: any
|
||||
}
|
||||
|
||||
declare global {
|
||||
|
Loading…
Reference in New Issue
Block a user