import { ChangeFieldType, HexString, StreamID, UserID } from '@streamr/utils';
import { StreamIDBuilder } from './StreamIDBuilder';
export declare enum StreamPermission {
    EDIT = "edit",
    DELETE = "delete",
    PUBLISH = "publish",
    SUBSCRIBE = "subscribe",
    GRANT = "grant"
}
export interface UserPermissionQuery {
    streamId: string;
    permission: StreamPermission;
    userId: HexString;
    allowPublic: boolean;
}
export interface PublicPermissionQuery {
    streamId: string;
    permission: StreamPermission;
    public: true;
}
export type PermissionQuery = UserPermissionQuery | PublicPermissionQuery;
export type InternalUserPermissionQuery = ChangeFieldType<ChangeFieldType<UserPermissionQuery, 'streamId', StreamID>, 'userId', UserID>;
export type InternalPublicPermissionQuery = ChangeFieldType<PublicPermissionQuery, 'streamId', StreamID>;
export type InternalPermissionQuery = InternalUserPermissionQuery | InternalPublicPermissionQuery;
export interface UserPermissionAssignment {
    permissions: StreamPermission[];
    userId: HexString;
}
export interface PublicPermissionAssignment {
    permissions: StreamPermission[];
    public: true;
}
export type PermissionAssignment = UserPermissionAssignment | PublicPermissionAssignment;
export type InternalPermissionAssignment = ChangeFieldType<UserPermissionAssignment, 'userId', UserID> | PublicPermissionAssignment;
export declare const PUBLIC_PERMISSION_USER_ID = "0x0000000000000000000000000000000000000000";
export type PermissionQueryResult = {
    id: string;
    userId: string;
} & ChainPermissions;
export interface ChainPermissions {
    canEdit: boolean;
    canDelete: boolean;
    publishExpiration: bigint;
    subscribeExpiration: bigint;
    canGrant: boolean;
}
export declare const isPublicPermissionQuery: (query: InternalPermissionQuery) => query is InternalPublicPermissionQuery;
export declare const toInternalPermissionQuery: (query: PermissionQuery, streamIdBuilder: StreamIDBuilder) => Promise<InternalPermissionQuery>;
export declare const isPublicPermissionAssignment: (assignment: InternalPermissionAssignment) => assignment is PublicPermissionAssignment;
export declare const toInternalPermissionAssignment: (assignment: PermissionAssignment) => InternalPermissionAssignment;
export declare const streamPermissionToSolidityType: (permission: StreamPermission) => bigint;
export declare const convertChainPermissionsToStreamPermissions: (chainPermissions: ChainPermissions) => StreamPermission[];
export declare const convertStreamPermissionsToChainPermission: (permissions: StreamPermission[]) => ChainPermissions;
