/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import type { FilesystemSync } from "@nacho-iot/js-tools";
import type { PicsFile } from "./chip/pics/file.js";
/**
 * Metadata for a single test or group of tests.
 */
export interface TestDescriptor {
    name: string;
    kind: TestDescriptor.Kind;
    path?: string;
    subpath?: string;
    app?: string;
    members?: TestDescriptor[];
    isDisabled?: boolean;
    timeoutMs?: number;
    description?: string;
    pics?: string;
    config?: Record<string, unknown>;
    startUncommissioned?: boolean;
    runAt?: Date;
    passed?: boolean;
    durationMs?: number;
    picsValues?: PicsFile;
}
export interface TestFileDescriptor extends TestDescriptor {
    path: string;
}
export interface TestSuiteDescriptor extends TestDescriptor {
    members: TestDescriptor[];
}
export interface RootTestDescriptor extends TestDescriptor {
    format?: number;
}
export declare namespace TestDescriptor {
    /**
     * Used to validate format of test descriptor files.
     */
    const CURRENT_FORMAT = 2;
    type Kind = "suite" | "js" | "py" | "yaml" | "manual" | "step";
    const DEFAULT_FILENAME = "build/test-report.json";
    interface Filesystem extends FilesystemSync<Stat> {
        descriptor: TestDescriptor;
    }
    interface Stat extends FilesystemSync.Stat {
        descriptor: TestDescriptor;
    }
    type Criteria = {
        includePaths?: string[];
        kinds?: Kind[];
        pics?: PicsFile;
        predicate?: (descriptor: TestDescriptor) => boolean;
    };
    /**
     * Create a filter function for specified criteria.
     *
     * The filter treats tests as atomic and ignores empty suites.
     */
    function filter(descriptor: TestDescriptor, criteria: Criteria): TestDescriptor | undefined;
    /**
     * Visit a {@link TestDescriptor} hierarchy.
     */
    function visit(descriptor: TestDescriptor, fn: (descriptor: TestDescriptor) => void | boolean): void;
    /**
     * Load an existing persisted descriptor or create a new one.
     */
    function open(path: string): Promise<TestSuiteDescriptor>;
    /**
     * Persist a descriptor.
     */
    function save(path: string, descriptor: TestSuiteDescriptor): Promise<void>;
    /**
     * Create a new test descriptor that combines information from a previous run with a new run.
     *
     * We do not just overwrite the descriptor because a {@link TestSuiteDescriptor} will not include information about
     * tests that were excluded from a run.
     */
    function merge<T extends TestDescriptor>(previous: TestDescriptor, updates: T): T;
    /**
     * A {@link FilesystemSync} adapter for {@link TestDescriptor}.
     */
    function Filesystem(root: TestDescriptor): TestDescriptor.Filesystem;
}
//# sourceMappingURL=test-descriptor.d.ts.map