import type { AnyComponent } from "@fluid-app/portal-core/types";
import type { WidgetManifest } from "@fluid-app/portal-core/registries";
import type { WidgetPackageDescriptor, WidgetPackageType, WidgetRuntimeContainer, WidgetRuntimeResizable } from "../types/widget-package-descriptor";
declare const SOURCE_WIDGET_MARKER = "__fluidSourceWidget";
declare const SOURCE_WIDGET_PACKAGE_MARKER = "__fluidSourceWidgetPackage";
export type WidgetSourceDefaultProps = Readonly<Record<string, unknown>>;
export type WidgetSourceResizable = WidgetRuntimeResizable | {
    readonly horizontal?: boolean;
    readonly vertical?: boolean;
    readonly minWidth?: number;
    readonly minHeight?: number;
};
export interface DefineWidgetOptions<Name extends string = string, Props extends WidgetSourceDefaultProps = WidgetSourceDefaultProps> {
    /** Stable widget name within its package. Used as the last segment of the widget type. */
    readonly name: Name;
    /** React component that renders this widget in source/preview contexts. */
    readonly component: AnyComponent;
    readonly displayName?: string;
    readonly description?: string;
    readonly icon?: string;
    readonly category?: string;
    readonly propertySchema?: Readonly<Record<string, unknown>>;
    readonly defaultProps?: Partial<Props> & WidgetSourceDefaultProps;
    readonly container?: WidgetRuntimeContainer;
    readonly minSdkVersion?: string;
    readonly resizable?: WidgetSourceResizable;
}
export interface SourceWidget<Name extends string = string, Props extends WidgetSourceDefaultProps = WidgetSourceDefaultProps> extends DefineWidgetOptions<Name, Props> {
    readonly [SOURCE_WIDGET_MARKER]: true;
    readonly defaultProps: Partial<Props> & WidgetSourceDefaultProps;
}
interface DefineWidgetPackageOptionsBase<Scope extends string, PackageStableId extends string> {
    /** Stable namespace for the package, for example a company or partner slug. */
    readonly scope: Scope;
    /**
     * Stable package key. Managed droplet widget projects created by
     * `fluid widget` should omit this; the CLI injects it during build/publish.
     * Company-owned and other non-droplet packages must provide it.
     */
    readonly stableId?: PackageStableId;
    /**
     * Stable package key. Managed droplet widget projects created by
     * `fluid widget` should omit this; the CLI injects it during build/publish.
     * Company-owned and other non-droplet packages must provide it.
     */
    readonly packageStableId?: PackageStableId;
    readonly packageType?: WidgetPackageType;
    readonly version?: string;
    readonly widgets: readonly SourceWidget[];
    readonly cssUrls?: readonly string[];
    /** Optional runtime remote entry. Runtime descriptors are omitted when absent. */
    readonly remoteEntryUrl?: string;
}
export type DefineWidgetPackageOptions<Scope extends string = string, PackageStableId extends string = string> = DefineWidgetPackageOptionsBase<Scope, PackageStableId>;
export interface SourceWidgetPackage<Scope extends string = string, PackageStableId extends string = string> {
    readonly [SOURCE_WIDGET_PACKAGE_MARKER]: true;
    readonly manifestVersion: 1;
    readonly scope: Scope;
    readonly packageStableId: PackageStableId;
    readonly packageId: `${Scope}.${PackageStableId}`;
    readonly packageType: WidgetPackageType;
    readonly version: string;
    readonly widgets: readonly SourceWidget[];
    readonly cssUrls: readonly string[];
    readonly remoteEntryUrl?: string;
}
export interface SourceWidgetPackageDescriptorOptions {
    /**
     * Fallback runtime remote entry URL used only when a source package does not
     * define its own non-empty `remoteEntryUrl`.
     */
    readonly remoteEntryUrl?: string | ((sourcePackage: SourceWidgetPackage) => string);
    /**
     * Fallback runtime CSS URLs used only when a source package does not define
     * any package-level `cssUrls` and the descriptor uses the fallback
     * `remoteEntryUrl`.
     */
    readonly cssUrls?: readonly string[];
}
export declare function defineWidget<const Name extends string, Props extends WidgetSourceDefaultProps = WidgetSourceDefaultProps>(options: DefineWidgetOptions<Name, Props>): SourceWidget<Name, Props>;
export declare function defineWidgetPackage<const Scope extends string, const PackageStableId extends string>(options: DefineWidgetPackageOptions<Scope, PackageStableId>): SourceWidgetPackage<Scope, PackageStableId>;
export declare function isSourceWidget(value: unknown): value is SourceWidget;
export declare function isSourceWidgetPackage(value: unknown): value is SourceWidgetPackage;
export declare function sourceWidgetPackageToDescriptor(sourcePackage: SourceWidgetPackage, options?: SourceWidgetPackageDescriptorOptions): WidgetPackageDescriptor | undefined;
export declare function sourceWidgetPackagesToDescriptors(sourcePackages: readonly SourceWidgetPackage[], options?: SourceWidgetPackageDescriptorOptions): WidgetPackageDescriptor[];
export declare function sourceWidgetPackageToManifests(sourcePackage: SourceWidgetPackage): WidgetManifest[];
export declare function sourceWidgetPackagesToManifests(sourcePackages: readonly SourceWidgetPackage[]): WidgetManifest[];
export {};
//# sourceMappingURL=authoring.d.ts.map