import type { DocumentLocation, ExpressionValueType } from '../model/malloy_types'; import type { EventStream } from '../runtime_types'; export type LogSeverity = 'error' | 'warn' | 'debug'; /** * Default severity is "error" */ export interface LogMessage { message: string; at?: DocumentLocation; severity: LogSeverity; code: string; replacement?: string; errorTag?: string; data?: any; } export interface MessageLogger { log(logMsg: LogMessage): void; reset(): void; getLog(): LogMessage[]; hasErrors(): boolean; noErrors(): boolean; empty(): boolean; } export declare class BaseMessageLogger implements MessageLogger { private readonly eventStream; private rawLog; constructor(eventStream: EventStream | null); getLog(): LogMessage[]; /** * Add a message to the log. */ log(logMsg: LogMessage): void; reset(): void; noErrors(): boolean; hasErrors(): boolean; empty(): boolean; } type MessageParameterTypes = { 'pick-type-does-not-match': { pickType: ExpressionValueType; returnType: ExpressionValueType; }; 'pick-else-type-does-not-match': { elseType: ExpressionValueType; returnType: ExpressionValueType; }; 'pick-default-type-does-not-match': { defaultType: ExpressionValueType; returnType: ExpressionValueType; }; 'pick-missing-else': {}; 'pick-missing-value': {}; 'pick-illegal-partial': {}; 'pick-when-must-be-boolean': { whenType: ExpressionValueType; }; 'pick-non-atomic-type': string; 'experiment-not-enabled': { experimentId: string; }; 'experimental-dialect-not-enabled': { dialect: string; }; 'sql-native-not-allowed-in-expression': { rawType: string | undefined; }; 'ambiguous-view-type': {}; 'failed-to-compute-absolute-import-url': string; 'import-error': { message: string; url: string; }; 'parsed-non-malloy-document': { url: string; }; 'parse-exception': { message: string; }; 'syntax-error': { message: string; }; 'internal-translator-error': { message: string; }; 'invalid-timezone': { timezone: string; }; 'aggregate-source-not-found': string; 'name-conflict-with-global': string; 'too-many-arguments-for-time-extraction': string; 'invalid-type-for-time-extraction': string; 'invalid-types-for-time-measurement': string; 'invalid-timeframe-for-time-measurement': string; 'invalid-time-extraction-unit': string; 'untranslated-parse-node': string; 'invalid-aggregate-source': string; 'missing-aggregate-expression': string; 'aggregate-of-aggregate': string; 'bad-join-usage': string; 'aggregate-traverses-join-cross': string; 'aggregate-traverses-join-many': string; 'aggregate-traverses-repeated-relationship': string; 'alternation-as-value': string; 'invalid-sql-native-type': string; 'mismatched-coalesce-types': string; 'function-not-found': string; 'case-insensitive-function': string; 'call-of-non-function': string; 'no-matching-function-overload': string; 'invalid-function-argument-expression-type': string; 'invalid-function-argument-evaluation-space': string; 'literal-null-function-argument': string; 'non-aggregate-function-with-source': string; 'aggregate-order-by-experiment-not-enabled': string; 'function-does-not-support-order-by': string; 'function-does-not-support-limit': string; 'partition-by-not-found': string; 'non-scalar-or-aggregate-partition-by': string; 'sql-functions-experiment-not-enabled': string; 'invalid-sql-function-argument': string; 'unsupported-sql-function-interpolation': string; 'sql-function-interpolation-not-found': string; 'function-returns-any': string; 'unsupported-type-for-time-truncation': string; 'filter-of-non-aggregate': string; 'aggregate-filter-expression-not-scalar': string; 'partition-by-of-non-window-function': string; 'expression-limit-already-specified': string; 'limit-of-non-aggregate-function': string; 'order-by-of-non-aggregate-function': string; 'unsupported-type-for-time-extraction': string; 'ungroup-of-non-aggregate': string; 'ungroup-of-ungrouped-aggregate': string; 'ungroup-field-not-in-output': string; 'ungroup-with-non-scalar': string; 'invalid-duration-quantity': string; 'range-as-value': string; 'analytic-order-by-missing-field': string; 'analytic-order-by-not-output': string; 'analytic-order-by-not-aggregate-or-output': string; 'aggregate-order-by-not-scalar': string; 'aggregate-order-by-expression-not-allowed': string; 'aggregate-order-by-without-field-or-direction': string; 'partial-as-value': string; 'top-by-non-aggregate': string; 'definition-name-conflict': string; 'invalid-field-in-index-query': string; 'invalid-wildcard-source': string; 'wildcard-source-not-found': string; 'name-conflict-in-wildcard-expansion': string; 'invalid-parameter-reference': string; 'parameter-not-found': string; 'wildcard-source-not-defined': string; 'unexpected-index-segment': string; 'accept-parameter': string; 'except-parameter': string; 'field-list-edit-not-found': string; 'unexpected-element-type': string; 'field-not-found': string; 'composite-field-type-mismatch': string; 'invalid-composite-source-input': string; 'could-not-resolve-composite-source': string; 'empty-composite-source': string; 'unnecessary-composite-source': string; 'composite-source-atomic-fields-only': string; 'composite-source-connection-mismatch': string; 'invalid-property-access-in-field-reference': string; 'parameter-default-does-not-match-declared-type': string; 'parameter-null-default-without-declared-type': string; 'parameter-illegal-default-type': string; 'parameter-missing-default-or-type': string; 'index-limit-already-specified': string; 'index-by-already-specified': string; 'illegal-operation-for-index': string; 'refinement-of-index-segment': string; 'incompatible-segment-for-select-refinement': string; 'illegal-operation-in-select-segment': string; 'limit-already-specified': string; 'ordering-already-specified': string; 'incompatible-segment-for-reduce-refinement': string; 'query-reference-not-found': string; 'non-query-used-as-query': string; 'failed-field-definition': string; 'null-typed-field-definition': string; 'invalid-type-for-field-definition': string; 'circular-reference-in-field-definition': string; 'output-name-conflict': string; 'select-of-view': string; 'select-of-analytic': string; 'select-of-aggregate': string; 'aggregate-in-dimension': string; 'index-of-view': string; 'index-of-analytic': string; 'index-of-aggregate': string; 'analytic-in-dimension': string; 'scalar-in-measure': string; 'analytic-in-measure': string; 'view-in-declare': string; 'analytic-in-declare': string; 'calculate-of-view': string; 'calculate-of-aggregate': string; 'calculate-of-scalar': string; 'aggregate-of-view': string; 'aggregate-of-analytic': string; 'aggregate-of-scalar': string; 'group-by-view': string; 'group-by-analytic': string; 'group-by-aggregate': string; 'non-boolean-filter': string; 'analytic-in-having': string; 'analytic-in-where': string; 'aggregate-in-where': string; 'order-by-not-found-in-output': string; 'order-by-analytic': string; 'illegal-index-operation': string; 'illegal-project-operation': string; 'illegal-grouping-operation': string; 'top-by-not-found-in-output': string; 'top-by-analytic': string; 'top-by-aggregate': string; 'top-by-not-in-output': string; 'source-not-found': string; 'invalid-source-from-query': string; 'invalid-source-from-function': string; 'invalid-source-from-connection': string; 'invalid-source-source': string; 'unnamed-source-argument': string; 'duplicate-source-argument': string; 'source-parameter-not-found': string; 'missing-source-argument': string; 'multiple-field-list-edits': string; 'multiple-primary-keys': string; 'unexpected-source-property': string; 'aggregate-in-source-filter': string; 'invalid-connection-for-sql-source': string; 'failed-to-fetch-sql-source-schema': string; 'invalid-sql-source': string; 'non-top-level-sql-source': string; 'failed-to-fetch-table-schema': string; 'invalid-connection-for-table-source': string; 'join-on-primary-key-type-mismatch': string; 'join-primary-key-not-found': string; 'join-with-without-primary-key': string; 'non-boolean-join-on': string; 'invalid-rename-with-same-name': string; 'failed-rename': string; 'rename-field-not-found': string; 'invalid-join-source': string; 'failed-to-compute-arrow-source': string; 'failed-to-compute-source-from-query': string; 'failed-to-compute-source-to-extend': string; 'cannot-use-as-query': string; 'source-or-query-not-found': string; 'illegal-query-argument': string; 'cannot-use-struct-as-source': string; 'illegal-refinement-of-source': string; 'invalid-source-as-query': string; 'invalid-sql-source-interpolation': string; 'failed-to-expand-sql-source': string; 'query-definition-name-conflict': string; 'query-definition-from-non-query': string; 'source-definition-name-conflict': string; 'parameter-name-conflict': string; 'parameter-shadowing-field': string; 'invalid-import-url': string; 'no-translator-for-import': string; 'name-conflict-on-selective-import': string; 'selective-import-not-found': string; 'name-conflict-on-indiscriminate-import': string; 'failed-import': string; 'failed-to-compute-output-schema': string; 'invalid-timeframe-for-time-offset': string; 'time-comparison-type-mismatch': string; 'arithmetic-operation-type-mismatch': string; 'time-offset-type-mismatch': string; 'unexpected-binary-operator': string; 'illegal-reference-in-parameter-default': string; 'aggregate-analytic-in-select': string; 'refinement-of-raw-query': string; 'illegal-multistage-refinement-operation': string; 'illegal-refinement-operation': string; 'view-not-found': string; 'refinement-with-joined-view': string; 'nest-of-joined-view': string; 'refinement-with-source': string; 'nest-of-source': string; 'mismatched-view-types-for-refinement': string; 'ordering-overridden-in-refinement': string; 'limit-overridden-in-refinement': string; 'name-conflict-in-refinement': string; 'refinement-with-multistage-view': string; 'foreign-key-in-join-cross': string; 'expression-type-error': string; 'unexpected-statement-in-translation': string; 'illegal-query-interpolation-outside-sql-block': string; 'percent-terminated-query-interpolation': string; 'failed-to-parse-time-literal': string; 'table-function': string; 'missing-on-in-join-many': string; 'foreign-key-in-join-many': string; 'join-statement-in-view': string; 'unknown-matrix-operation': string; 'declare': string; 'query-in-source': string; 'invalid-reference-only-aggregation': string; 'project': string; 'top-by': string; 'anonymous-query': string; 'anonymous-nest': string; 'count-expression-with-locality': string; 'invalid-symmetric-aggregate': string; 'invalid-asymmetric-aggregate': string; 'aggregate-parse-error': string; 'wildcard-in-aggregate': string; 'unexpected-malloy-type': string; 'failed-to-parse-function-name': string; 'orphaned-object-annotation': string; 'misplaced-model-annotation': string; 'unexpected-non-source-query-expression-node': string; 'sql-not-like': string; 'sql-like': string; 'sql-is-not-null': string; 'sql-is-null': string; 'illegal-record-property-type': string; 'record-literal-needs-keys': string; 'not-yet-implemented': string; 'cannot-rename-join-field': string; 'sql-case': string; 'case-then-type-does-not-match': { thenType: ExpressionValueType; returnType: ExpressionValueType; }; 'case-else-type-does-not-match': { elseType: ExpressionValueType; returnType: ExpressionValueType; }; 'case-when-must-be-boolean': { whenType: ExpressionValueType; }; 'case-when-type-does-not-match': { whenType: ExpressionValueType; valueType: ExpressionValueType; }; 'or-choices-only': string; 'sql-in': string; 'except-star-and-list': string; 'dialect-cast-unsafe-only': string; 'field-not-accessible': string; 'cannot-expand-access': string; 'conflicting-access-modifier': string; 'accept-except-not-compatible-with-include': string; 'already-renamed': string; 'wildcard-except-redundant': string; 'already-used-star-in-include': string; 'include-after-exclude': string; 'duplicate-include': string; 'exclude-after-include': string; 'exclude-after-exclude': string; 'cannot-rename-non-field': string; 'array-values-incompatible': string; 'invalid-resolved-type-for-array': string; 'generic-not-resolved': string; 'cannot-tag-include-except': string; 'unsupported-path-in-include': string; 'wildcard-include-rename': string; 'literal-string-newline': string; 'filter-expression-type': string; 'filter-expression-error': string; 'invalid-malloy-query-document': string; 'analytic-in-drill': string; 'aggregate-in-drill': string; 'illegal-drill': string; 'drill-not-equality': string; 'drill-lhs-not-id': string; 'drill-rhs-not-literal': string; 'invalid-drill-reference': string; 'drill-view-reference-not-found': string; 'drill-view-reference-not-field': string; 'drill-view-reference-not-view': string; 'drill-incompatible-segment': string; 'drill-nest-not-found': string; 'drill-field-not-found': string; 'drill-field-reference-not-field': string; 'grouped-by-not-found': string; 'non-scalar-grouped-by': string; 'missing-required-group-by': string; 'invalid-partition-composite': string; }; export declare const MESSAGE_FORMATTERS: PartialErrorCodeMessageMap; export type MessageCode = keyof MessageParameterTypes; export type MessageParameterType = MessageParameterTypes[T]; type MessageCodeAndParameters = { code: T; parameters: MessageParameterType; }; export type AnyMessageCodeAndParameters = MessageCodeAndParameters; type MessageFormatter = MessageInfo | ((parameters: MessageParameterType) => MessageInfo); type ErrorCodeMessageMap = { [key in keyof MessageParameterTypes]: MessageFormatter; }; type PartialErrorCodeMessageMap = Partial; type MessageInfo = string | { message: string; severity?: LogSeverity; replacement?: string; tag?: string; data?: any; }; export interface ALogMessage { code: T; message: string; at?: DocumentLocation; data: MessageParameterType; severity: LogSeverity; errorTag?: string; replacement?: string; } export type AnyLogMessage = ALogMessage; export interface LogMessageOptions { replacement?: string; at?: DocumentLocation; severity?: LogSeverity; tag?: string; } export declare function makeLogMessage(code: T, parameters: MessageParameterType, options?: LogMessageOptions): LogMessage; export {};