/**
 * Utility module for handling resource folder naming conventions.
 *
 * This module centralizes the logic for detecting and manipulating paths
 * that contain resource folders (.flow, .app, .raw_app).
 *
 * The folder suffixes can be configured to use either dot-prefixed names
 * (.flow, .app, .raw_app) or dunder-prefixed names (__flow, __app, __raw_app).
 */
export type FolderResourceType = "flow" | "app" | "raw_app";
declare const DOTTED_SUFFIXES: {
    readonly flow: ".flow";
    readonly app: ".app";
    readonly raw_app: ".raw_app";
};
declare const NON_DOTTED_SUFFIXES: {
    readonly flow: "__flow";
    readonly app: "__app";
    readonly raw_app: "__raw_app";
};
export type FolderSuffixes = typeof DOTTED_SUFFIXES | typeof NON_DOTTED_SUFFIXES;
/**
 * Set whether to use non-dotted paths (__flow, __app, __raw_app)
 * instead of dotted paths (.flow, .app, .raw_app).
 * This should be called once at startup based on wmill.yaml configuration.
 */
export declare function setNonDottedPaths(value: boolean): void;
/**
 * Get the current nonDottedPaths setting.
 */
export declare function getNonDottedPaths(): boolean;
/**
 * Get the folder suffixes based on the global configuration.
 */
export declare function getFolderSuffixes(): FolderSuffixes;
/**
 * Get the folder suffix for a resource type (e.g., ".flow", ".app", ".raw_app" or "__flow", "__app", "__raw_app")
 */
export declare function getFolderSuffix(type: FolderResourceType): string;
/**
 * Get the folder suffix with path separator (e.g., ".flow/", ".app/", ".raw_app/")
 */
export declare function getFolderSuffixWithSep(type: FolderResourceType): string;
/**
 * Get the metadata file name for a resource type
 */
export declare function getMetadataFileName(type: FolderResourceType, format: "yaml" | "json"): string;
/**
 * Get the full metadata file path suffix (e.g., ".flow/flow.yaml" or "__flow/flow.yaml")
 */
export declare function getMetadataPathSuffix(type: FolderResourceType, format: "yaml" | "json"): string;
/**
 * Check if a path is inside a flow folder
 */
export declare function isFlowPath(p: string): boolean;
/**
 * Check if a path is inside an app folder
 */
export declare function isAppPath(p: string): boolean;
/**
 * Check if a path is inside a raw_app folder
 */
export declare function isRawAppPath(p: string): boolean;
/**
 * Check if a path is inside any folder-based resource (flow, app, or raw_app)
 */
export declare function isFolderResourcePath(p: string): boolean;
/**
 * Detect the resource type from a path, if any
 */
export declare function detectFolderResourceType(p: string): FolderResourceType | null;
/**
 * Check if a path is inside a raw app backend folder.
 * Matches patterns like: .../myApp.raw_app/backend/... or .../myApp__raw_app/backend/...
 */
export declare function isRawAppBackendPath(filePath: string): boolean;
/**
 * Check if a path is inside a normal app folder (inline script).
 * Matches patterns like: .../myApp.app/... or .../myApp__app/...
 * This is used to detect inline scripts that belong to normal apps.
 */
export declare function isAppInlineScriptPath(filePath: string): boolean;
/**
 * Check if a path is inside a flow folder (inline script).
 * Matches patterns like: .../myFlow.flow/... or .../myFlow__flow/...
 * This is used to detect inline scripts that belong to flows.
 */
export declare function isFlowInlineScriptPath(filePath: string): boolean;
/**
 * Extract the resource name from a path (the part before the folder suffix)
 * e.g., "f/my_flow.flow/flow.yaml" -> "f/my_flow"
 */
export declare function extractResourceName(p: string, type: FolderResourceType): string | null;
/**
 * Extract the folder path (resource name + folder suffix)
 * e.g., "f/my_flow.flow/flow.yaml" -> "f/my_flow.flow/"
 */
export declare function extractFolderPath(p: string, type: FolderResourceType): string | null;
/**
 * Build a folder path from a resource name
 * e.g., ("f/my_flow", "flow") -> "f/my_flow.flow"
 */
export declare function buildFolderPath(resourceName: string, type: FolderResourceType): string;
/**
 * Build a metadata file path from a resource name
 * e.g., ("f/my_flow", "flow", "yaml") -> "f/my_flow.flow/flow.yaml"
 */
export declare function buildMetadataPath(resourceName: string, type: FolderResourceType, format: "yaml" | "json"): string;
/**
 * Check if a directory name ends with a specific resource folder suffix
 * e.g., "my_app.raw_app" ends with ".raw_app" or "my_app__raw_app" ends with "__raw_app"
 */
export declare function hasFolderSuffix(dirName: string, type: FolderResourceType): boolean;
/**
 * Validate that a directory name has the expected folder suffix
 * Returns an error message if invalid, null if valid
 */
export declare function validateFolderName(dirName: string, type: FolderResourceType): string | null;
/**
 * Extract the resource name from a folder name by removing the suffix
 * e.g., "my_app.raw_app" -> "my_app" or "my_app__raw_app" -> "my_app"
 */
export declare function extractNameFromFolder(folderName: string, type: FolderResourceType): string;
/**
 * Check if a path ends with a flow metadata file suffix.
 * Detects BOTH API format (always dotted: .flow.json) and local format (user-configured).
 * This is necessary because the API always returns dotted format, but local files
 * may use non-dotted format if nonDottedPaths is configured.
 */
export declare function isFlowMetadataFile(p: string): boolean;
/**
 * Check if a path ends with an app metadata file suffix.
 * Detects BOTH API format (always dotted: .app.json) and local format (user-configured).
 */
export declare function isAppMetadataFile(p: string): boolean;
/**
 * Check if a path ends with a raw_app metadata file suffix.
 * Detects BOTH API format (always dotted: .raw_app.json) and local format (user-configured).
 */
export declare function isRawAppMetadataFile(p: string): boolean;
/**
 * Check if a path ends with a specific raw_app metadata file
 * (inside the folder, e.g., ".raw_app/raw_app.yaml" or "__raw_app/raw_app.yaml")
 */
export declare function isRawAppFolderMetadataFile(p: string): boolean;
/**
 * Get the path suffix to remove when converting local path to API path
 * for delete operations
 */
export declare function getDeleteSuffix(type: FolderResourceType, format: "yaml" | "json"): string;
/**
 * Transform a JSON path from API format to local directory path for sync.
 * The API always returns dotted format (.flow.json, .app.json, .raw_app.json).
 * This function transforms to the user's configured format (dotted or non-dotted).
 * e.g., with nonDottedPaths=true: "f/my_flow.flow.json" -> "f/my_flow__flow"
 * e.g., with nonDottedPaths=false: "f/my_flow.flow.json" -> "f/my_flow.flow"
 */
export declare function transformJsonPathToDir(p: string, type: FolderResourceType): string;
export {};
//# sourceMappingURL=resource_folders.d.ts.map