UNPKG

2.3 kBTypeScriptView Raw
1/**
2 * Copyright (c) 2002-2019 "Neo4j,"
3 * Neo4j Sweden AB [http://neo4j.com]
4 *
5 * This file is part of Neo4j.
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 */
19
20import Integer from './integer'
21import { NumberOrInteger } from './graph-types'
22
23declare interface ResultSummary<T extends NumberOrInteger = Integer> {
24 query: { text: string; parameters: { [key: string]: any } }
25 queryType: string
26 counters: QueryStatistic
27 plan: Plan
28 profile: ProfiledPlan
29 notifications: Notification[]
30 server: ServerInfo
31 resultConsumedAfter: T
32 resultAvailableAfter: T
33
34 hasPlan(): boolean
35
36 hasProfile(): boolean
37}
38
39declare interface Plan {
40 operatorType: string
41 identifiers: string[]
42 arguments: { [key: string]: string }
43 children: Plan[]
44}
45
46declare interface ProfiledPlan {
47 operatorType: string
48 identifiers: string[]
49 arguments: { [key: string]: string }
50 dbHits: number
51 rows: number
52 pageCacheMisses: number
53 pageCacheHits: number
54 pageCacheHitRatio: number
55 time: number
56
57 hasPageCacheStats(): boolean
58
59 children: ProfiledPlan[]
60}
61
62declare interface QueryStatistic {
63 containsUpdates(): boolean
64
65 containsSystemUpdates(): boolean
66
67 updates(): { [key: string]: number }
68
69 systemUpdates(): number
70}
71
72declare type NotificationPosition = {
73 offset: number
74 line: number
75 column: number
76}
77
78declare interface Notification {
79 code: string
80 title: string
81 description: string
82 severity: string
83 position: NotificationPosition | {}
84}
85
86declare interface ServerInfo {
87 address: string
88 version: string
89}
90
91declare const queryType: {
92 READ_ONLY: 'r'
93 READ_WRITE: 'rw'
94 WRITE_ONLY: 'w'
95 SCHEMA_WRITE: 's'
96}
97
98export {
99 queryType,
100 Plan,
101 ProfiledPlan,
102 QueryStatistic,
103 Notification,
104 ServerInfo,
105 NotificationPosition
106}
107
108export default ResultSummary