import * as _$_zenstackhq_orm0 from "@zenstackhq/orm"; import { ClientContract, ClientOptions } from "@zenstackhq/orm"; import { LogEvent } from "kysely"; import { SchemaDef } from "@zenstackhq/orm/schema"; import * as _$_zenstackhq_language_ast0 from "@zenstackhq/language/ast"; import { DataSourceProviderType, SchemaDef as SchemaDef$1 } from "@zenstackhq/schema"; //#region src/client.d.ts declare function getTestDbProvider(): "sqlite" | "postgresql" | "mysql"; declare const TEST_PG_CONFIG: { host: string; port: number; user: string; password: string; }; declare const TEST_PG_URL: string; declare const TEST_MYSQL_CONFIG: { host: string; port: number; user: string; password: string; timezone: string; }; declare const TEST_MYSQL_URL: string; type ExtraTestClientOptions = { /** * Database provider */ provider?: 'sqlite' | 'postgresql' | 'mysql'; /** * The main ZModel file. Only used when `usePrismaPush` is true and `schema` is an object. */ schemaFile?: string; /** * Database name. If not provided, a name will be generated based on the test name. */ dbName?: string; /** * Use `prisma db push` instead of ZenStack's `$pushSchema` for database initialization. */ usePrismaPush?: boolean; /** * Extra ZModel files to be created in the working directory. */ extraZModelFiles?: Record; /** * Extra plugin `plugin.zmodel` files (resolved absolute paths) to merge into the schema * when loading. Use this to make a plugin's custom attributes available without testtools * having to depend on the plugin. */ extraPluginModelFiles?: string[]; /** * Extra TypeScript source files to create and compile. */ extraSourceFiles?: Record; /** * Working directory for the test client. If not provided, a temporary directory will be created. */ workDir?: string; /** * Debug mode. */ debug?: boolean; /** * A sqlite database file to be used for the test. Only supported for sqlite provider. */ dbFile?: string; /** * PostgreSQL extensions to be added to the datasource. Only supported for postgresql provider. */ dataSourceExtensions?: string[]; /** * Additional files to be copied to the working directory. The glob pattern is relative to the test file. */ copyFiles?: { globPattern: string; destination: string; }[]; /** * Computed fields configuration for tests. */ computedFields?: _$_zenstackhq_orm0.ComputedFieldsOptions; }; type CreateTestClientOptions = Omit, 'dialect'> & ExtraTestClientOptions; declare function createTestClient, CreateOptions = Omit>(schema: Schema, options?: CreateOptions): Promise>; declare function createTestClient(schema: string, options?: CreateTestClientOptions): Promise; declare function createPolicyTestClient(schema: Schema, options?: CreateTestClientOptions): Promise>; declare function createPolicyTestClient(schema: string, options?: CreateTestClientOptions): Promise; declare function testLogger(e: LogEvent): void; //#endregion //#region src/project.d.ts declare function createTestProject(zmodelContent?: string): string; //#endregion //#region src/schema.d.ts declare function generateTsSchema(schemaText: string, provider?: DataSourceProviderType, dbUrl?: string, extraSourceFiles?: Record, withLiteSchema?: boolean, extraZModelFiles?: Record, extraPluginModelFiles?: string[]): Promise<{ model: _$_zenstackhq_language_ast0.Model; workDir: string; schema: SchemaDef$1; schemaLite: SchemaDef$1 | undefined; }>; declare function generateTsSchemaFromFile(filePath: string): Promise<{ model: _$_zenstackhq_language_ast0.Model; workDir: string; schema: SchemaDef$1; schemaLite: SchemaDef$1 | undefined; }>; declare function generateTsSchemaInPlace(schemaPath: string): Promise<{ workDir: string; schema: SchemaDef$1; schemaLite: SchemaDef$1 | undefined; }>; declare function loadSchema(schema: string, additionalSchemas?: Record): Promise<_$_zenstackhq_language_ast0.Model>; declare function loadSchemaWithError(schema: string, error: string | RegExp): Promise; //#endregion export { CreateTestClientOptions, TEST_MYSQL_CONFIG, TEST_MYSQL_URL, TEST_PG_CONFIG, TEST_PG_URL, createPolicyTestClient, createTestClient, createTestProject, generateTsSchema, generateTsSchemaFromFile, generateTsSchemaInPlace, getTestDbProvider, loadSchema, loadSchemaWithError, testLogger }; //# sourceMappingURL=index.d.mts.map