export function capability, C extends API.Caveats = {}>({ derives, nb, ...etc }: Descriptor): API.TheCapabilityParser>;
export function or, W extends API.Match>(left: API.Matcher, right: API.Matcher): API.CapabilityParser;
export function and>[]>(...selectors: Selectors): API.CapabilitiesParser>;
export function derive, T extends API.ParsedCapability>({ from, to, derives }: {
from: API.MatchSelector;
to: API.TheCapabilityParser>;
derives: API.Derives>;
}): API.TheCapabilityParser>;
export type Descriptor, C extends API.Caveats> = {
can: A;
with: API.Reader;
nb?: Schema.MapRepresentation | undefined;
derives?: ((claim: {
can: A;
with: R;
nb: C;
}, proof: {
can: A;
with: R;
nb: C;
}) => API.Result<{}, API.Failure>) | undefined;
};
import * as API from '@ucanto/interface';
/**
* @template {API.ParsedCapability} T
* @template {API.Match} M
* @implements {API.DerivedMatch}
*/
declare class DerivedMatch, M extends API.Match> implements API.DerivedMatch {
/**
* @param {API.DirectMatch} selected
* @param {API.MatchSelector} from
* @param {API.Derives>} derives
*/
constructor(selected: API.DirectMatch, from: API.MatchSelector, derives: API.Derives>);
selected: API.DirectMatch;
from: API.MatchSelector;
derives: API.Derives>;
get can(): API.Ability;
get source(): API.Source[];
get proofs(): API.Delegation[];
get value(): T;
/**
* @param {API.CanIssue} context
*/
prune(context: API.CanIssue): DerivedMatch | null;
/**
* @param {API.Source[]} capabilities
*/
select(capabilities: API.Source[]): {
unknown: API.Capability[];
errors: (API.DelegationError | MatchError)[];
matches: (DerivedMatch | M)[];
};
toString(): string;
}
import { Schema } from '@ucanto/core';
import { DelegationError as MatchError } from './error.js';
export {};
//# sourceMappingURL=capability.d.ts.map