import { Event, type PostPrimitives, type Posts } from '../types';
import { type UndefinedOr } from '@devprotocol/util-ts';
export type OnUpdateHandler = (post: PostPrimitives) => PostPrimitives | Promise<PostPrimitives>;
export type OnPostCreatedHandler = (post: Posts) => void | Promise<void>;
export type EventRegisterOnUpdateHandler = CustomEvent<{
    readonly handler?: OnUpdateHandler;
}>;
export type EventPostCreated = CustomEvent<{
    readonly post: Posts;
}>;
export declare const onUpdateHandlers: Set<OnUpdateHandler>;
export declare const handleRegisterOnUpdateHandler: (e: EventRegisterOnUpdateHandler) => Set<OnUpdateHandler>;
export declare const onUpdate: (handler: OnUpdateHandler) => boolean;
export declare const update: (_post: PostPrimitives) => Promise<PostPrimitives>;
export declare const EncodedPostClassName = "__input-encoded-post__";
export declare const currentPost: (handler: (post: Posts) => unknown, base: Readonly<Element>) => UndefinedOr<HTMLInputElement>;
export declare const onPostCreated: (handler: OnPostCreatedHandler) => false | void;
declare const PostCreated: Event, RegisterOnUpdateHandler: Event;
export declare const dispatchPostCreated: (post: Posts) => boolean;
declare global {
    interface DocumentEventMap {
        readonly [RegisterOnUpdateHandler]: EventRegisterOnUpdateHandler;
        readonly [PostCreated]: EventPostCreated;
    }
}
export {};
