import { EventEmitter } from './emitter.js';
import { EscrowSigner } from './signer.js';
import { EscrowContract } from './contract.js';
import { EscrowClient } from './client.js';
import { DraftItem } from '../types.js';
import { EventMessage, NostrRoom, SocketConfig } from '@cmdcode/nostr-sdk';
import { DraftData, MemberData, ProgramQuery, ProposalData, RolePolicy } from '../../types/index.js';
interface SessionConfig {
    debug: boolean;
    verbose: boolean;
}
export declare class DraftSession extends EventEmitter<{
    'approve': string;
    'commit': string;
    'confirmed': DraftSession;
    'debug': unknown[];
    'endorse': string;
    'error': [unknown, unknown];
    'fetch': DraftSession;
    'full': DraftSession;
    'info': unknown[];
    'join': MemberData;
    'leave': MemberData;
    'members': MemberData[];
    'proposal': ProposalData;
    'ready': DraftSession;
    'reject': [method: string, pub: string, reason: string];
    'roles': RolePolicy[];
    'signatures': string[];
    'terms': Partial<ProposalData>;
    'update': DraftSession;
    'published': string;
}> {
    static list(address: string, signer: EscrowSigner, options?: Partial<SocketConfig>): Promise<DraftItem[]>;
    readonly _opt: SessionConfig;
    readonly _signer: EscrowSigner;
    readonly _room: NostrRoom<DraftData>;
    _agreed: boolean;
    _full: boolean;
    _init: boolean;
    constructor(secret: string, signer: EscrowSigner, options?: Partial<SessionConfig>);
    get approvals(): string[];
    get available(): RolePolicy[];
    get data(): DraftData;
    get id(): string;
    get is_approved(): boolean;
    get is_confirmed(): boolean;
    get is_endorsed(): boolean;
    get is_full(): boolean;
    get is_member(): boolean;
    get is_moderated(): boolean;
    get is_moderator(): boolean;
    get is_ready(): boolean;
    get is_valid(): boolean;
    get members(): MemberData[];
    get member_idx(): number | null;
    get membership(): import("../types.js").Membership;
    get opt(): SessionConfig;
    get proposal(): ProposalData;
    get prop_id(): string;
    get pubkey(): string;
    get roles(): RolePolicy[];
    get secret(): string;
    get signatures(): string[];
    get signer(): EscrowSigner;
    get terms(): string[];
    get updated_at(): number;
    log: {
        debug: (...s: unknown[]) => void;
        info: (...s: unknown[]) => void;
    };
    _approve(sig: string, created_at?: number): void;
    _approve_handler(msg: EventMessage<string>): void;
    _endorse(sig: string, created_at?: number): void;
    _endorse_handler(msg: EventMessage<string>): void;
    _join(mship: MemberData, policy: RolePolicy, created_at?: number): void;
    _join_handler(msg: EventMessage): void;
    _leave(mship: MemberData, created_at?: number): void;
    _leave_handler(msg: EventMessage): void;
    _terms_handler(msg: EventMessage): void;
    _update_terms(terms: Partial<ProposalData>, created_at?: number): void;
    _update(data: DraftData, _cat?: number): Promise<void>;
    approve(): void;
    check_member(pubkey: string): boolean;
    check_terms(terms: Partial<ProposalData>): boolean;
    connect(address: string): Promise<this>;
    delete(): void;
    endorse(): void;
    fetch(): Promise<import("@cmdcode/nostr-sdk").NostrStore<DraftData>>;
    get_policy(pol_id: string): RolePolicy;
    get_program(query: ProgramQuery): import("../../types/index.js").ProgramData;
    get_role(title: string): RolePolicy;
    get_term<K extends keyof ProposalData>(key: K): ProposalData[K];
    has_policy(pol_id: string): boolean;
    has_program(query: ProgramQuery): boolean;
    has_role(title: string): boolean;
    has_term<K extends keyof ProposalData>(key: K): boolean;
    init(address: string, session: DraftData): Promise<NostrRoom<DraftData>>;
    join(policy_id: string, index?: number): void;
    leave(): void;
    list(address: string): Promise<import("@cmdcode/nostr-sdk").StoreItem[]>;
    publish(client: EscrowClient): Promise<EscrowContract>;
    update_terms(terms: Partial<ProposalData>): void;
    toJSON(): DraftData;
    toString(): string;
    verify(): void;
    when_commit(commit_id: string): Promise<unknown>;
}
export {};
