enonic-types
Advanced tools
Comparing version 0.2.13 to 0.2.14
@@ -5,8 +5,12 @@ export interface Request { | ||
readonly host: string; | ||
readonly port: string; | ||
readonly port: number; | ||
readonly path: string; | ||
readonly rawPath: string; | ||
readonly url: string; | ||
readonly remoteAddress: string; | ||
readonly mode: "inline" | "edit" | "preview" | "live"; | ||
readonly webSocket?: boolean; | ||
readonly repositoryId: string; | ||
readonly branch: "draft" | "master"; | ||
readonly contextPath: string; | ||
readonly body: string; | ||
@@ -22,3 +26,2 @@ readonly params: { | ||
}; | ||
readonly webSocket?: boolean; | ||
} | ||
@@ -25,0 +28,0 @@ export declare type ResponseType = string | object | Array<any> | ReadonlyArray<any> | null; |
@@ -1,2 +0,2 @@ | ||
import type { Content } from "./content"; | ||
import { EmptyObject } from "./content"; | ||
export interface GraphQlPlaygroundLibrary { | ||
@@ -122,19 +122,19 @@ render(): string; | ||
*/ | ||
createPageInfoObjectType<ExecuteContext = undefined>(params: CreatePageInfoObjectTypeParams<ExecuteContext>): GraphQLInfoObjectType; | ||
createPageInfoObjectType<ExecuteContext = EmptyObject>(params: CreatePageInfoObjectTypeParams<ExecuteContext>): GraphQLInfoObjectType; | ||
/** | ||
* Creates a GraphQL object type | ||
*/ | ||
createObjectType<ExecuteContext = undefined>(params: CreateObjectTypeParams<ExecuteContext>): GraphQLObjectType; | ||
createObjectType<ExecuteContext = EmptyObject>(params: CreateObjectTypeParams<ExecuteContext>): GraphQLObjectType; | ||
/** | ||
* createInputObjectType | ||
*/ | ||
createInputObjectType<ExecuteContext = undefined>(params: CreateInputObjectTypeParams<ExecuteContext>): GraphQLInputObjectType; | ||
createInputObjectType<ExecuteContext = EmptyObject>(params: CreateInputObjectTypeParams<ExecuteContext>): GraphQLInputObjectType; | ||
/** | ||
* Creates a GraphQL interface type | ||
*/ | ||
createInterfaceType<ExecuteContext = undefined>(params: CreateInterfaceTypeParams<ExecuteContext>): GraphQLInterfaceType; | ||
createInterfaceType<ExecuteContext = EmptyObject>(params: CreateInterfaceTypeParams<ExecuteContext>): GraphQLInterfaceType; | ||
/** | ||
* Creates a GraphQL union type | ||
*/ | ||
createUnionType<ExecuteContext = undefined>(params: CreateUnionTypeParams<ExecuteContext>): GraphQLUnionType; | ||
createUnionType<ExecuteContext = EmptyObject>(params: CreateUnionTypeParams<ExecuteContext>): GraphQLUnionType; | ||
/** | ||
@@ -156,13 +156,14 @@ * Creates a GraphQL enum type | ||
} | ||
export interface GraphQLResolver<ExecuteContext> { | ||
declare type GraphQLResolverCallback<ExecuteContext, Source> = (env: GraphQLResolverEnvironment<Source, ExecuteContext>) => unknown; | ||
export interface GraphQLResolver<ExecuteContext = EmptyObject, Source = any> { | ||
type: GraphQLType; | ||
args?: Record<string, GraphQLType>; | ||
resolve?: <Data extends object>(env: GraphQLResolverEnvironment<Data, ExecuteContext>) => unknown; | ||
resolve?: GraphQLResolverCallback<ExecuteContext, Source>; | ||
} | ||
export interface GraphQLResolverEnvironment<Data extends object, ExecuteContext> { | ||
source: Content<Data>; | ||
export interface GraphQLResolverEnvironment<Source = any, ExecuteContext = EmptyObject> { | ||
source: Source; | ||
args: Record<string, any>; | ||
context: ExecuteContext; | ||
} | ||
export interface CreateInterfaceTypeParams<ExecuteContext> { | ||
export interface CreateInterfaceTypeParams<ExecuteContext = EmptyObject> { | ||
readonly name: string; | ||
@@ -173,3 +174,3 @@ readonly fields: Record<string, GraphQLResolver<ExecuteContext>>; | ||
} | ||
export interface CreateUnionTypeParams<ExecuteContext> { | ||
export interface CreateUnionTypeParams<ExecuteContext = EmptyObject> { | ||
readonly name: string; | ||
@@ -179,3 +180,3 @@ readonly fields: Record<string, GraphQLResolver<ExecuteContext>>; | ||
} | ||
export interface CreatePageInfoObjectTypeParams<ExecuteContext> { | ||
export interface CreatePageInfoObjectTypeParams<ExecuteContext = EmptyObject> { | ||
readonly name: string; | ||
@@ -186,3 +187,3 @@ readonly fields: Record<string, GraphQLResolver<ExecuteContext>>; | ||
} | ||
export interface CreateObjectTypeParams<ExecuteContext> { | ||
export interface CreateObjectTypeParams<ExecuteContext = EmptyObject> { | ||
readonly name: string; | ||
@@ -193,3 +194,3 @@ readonly description: string; | ||
} | ||
export interface CreateInputObjectTypeParams<ExecuteContext> { | ||
export interface CreateInputObjectTypeParams<ExecuteContext = EmptyObject> { | ||
readonly name: string; | ||
@@ -200,1 +201,2 @@ readonly description: string; | ||
} | ||
export {}; |
import { WebSocketEvent } from "./controller"; | ||
import { CreateObjectTypeParams, GraphQLSchema, GraphQLType, SchemaGenerator } from "./graphql"; | ||
import { XOR } from "./types"; | ||
import { EmptyObject } from "./content"; | ||
export interface LibGuillotine { | ||
createSchema<ExecuteContext = undefined>(params?: ContextOptions<ExecuteContext>): GraphQLSchema; | ||
createSchema<ExecuteContext = EmptyObject>(params?: ContextOptions<ExecuteContext>): GraphQLSchema; | ||
createHeadlessCmsType(): GraphQLType; | ||
createContext<ExecuteContext = undefined>(options?: ContextOptions<ExecuteContext>): Context<ExecuteContext>; | ||
createContext<ExecuteContext = EmptyObject>(options?: ContextOptions<ExecuteContext>): Context<ExecuteContext>; | ||
initWebSockets(schema: GraphQLSchema): (event: WebSocketEvent) => void; | ||
@@ -12,3 +13,3 @@ createWebSocketData(req: CreateWebSocketDataParams): WebSocketData; | ||
} | ||
export interface ContextOptions<ExecuteContext> { | ||
export interface ContextOptions<ExecuteContext = EmptyObject> { | ||
applications?: Array<string>; | ||
@@ -20,3 +21,3 @@ allowPaths?: Array<string>; | ||
} | ||
export interface Context<ExecuteContext> { | ||
export interface Context<ExecuteContext = EmptyObject> { | ||
types: Record<string, GraphQLType>; | ||
@@ -23,0 +24,0 @@ dictionary: Array<unknown>; |
{ | ||
"name": "enonic-types", | ||
"sideEffects": false, | ||
"version": "0.2.13", | ||
"version": "0.2.14", | ||
"description": "TypeScript types for Enonic XP", | ||
@@ -27,7 +27,7 @@ "typings": "index.d.ts", | ||
"devDependencies": { | ||
"@typescript-eslint/eslint-plugin": "^4.29.1", | ||
"@typescript-eslint/parser": "^4.29.1", | ||
"@typescript-eslint/eslint-plugin": "^4.30.0", | ||
"@typescript-eslint/parser": "^4.30.0", | ||
"eslint": "^7.32.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-plugin-prettier": "^3.4.0", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
"prettier": "^2.3.2", | ||
@@ -34,0 +34,0 @@ "rimraf": "^3.0.2", |
129722
4110