|
1 | 1 | /// <reference types="ses"/>
|
| 2 | + |
| 3 | +/** @typedef {import('@endo/marshal').Passable} Passable */ |
| 4 | +/** @typedef {import('@endo/marshal').PassStyle} PassStyle */ |
| 5 | +/** @typedef {import('@endo/marshal').CopyTagged} CopyTagged */ |
| 6 | +/** @template T @typedef {import('@endo/marshal').CopyRecord<T>} CopyRecord */ |
| 7 | +/** @template T @typedef {import('@endo/marshal').CopyArray<T>} CopyArray */ |
| 8 | +/** @typedef {import('@endo/marshal').Checker} Checker */ |
| 9 | +/** @typedef {import('@endo/marshal').RankCompare} RankCompare */ |
| 10 | +/** @typedef {import('@endo/marshal').RankCover} RankCover */ |
| 11 | + |
| 12 | +/** @typedef {import('../types.js').AwaitArgGuard} AwaitArgGuard */ |
| 13 | +/** @typedef {import('../types.js').ArgGuard} ArgGuard */ |
| 14 | +/** @typedef {import('../types.js').MethodGuard} MethodGuard */ |
| 15 | +/** @typedef {import('../types.js').InterfaceGuard} InterfaceGuard */ |
| 16 | +/** @typedef {import('../types.js').MethodGuardMaker0} MethodGuardMaker0 */ |
| 17 | + |
| 18 | +/** @typedef {import('../types').MatcherNamespace} MatcherNamespace */ |
| 19 | +/** @typedef {import('../types').Key} Key */ |
| 20 | +/** @typedef {import('../types').Pattern} Pattern */ |
| 21 | +/** @typedef {import('../types').CheckPattern} CheckPattern */ |
| 22 | +/** @typedef {import('../types').Limits} Limits */ |
| 23 | +/** @typedef {import('../types').AllLimits} AllLimits */ |
| 24 | +/** @typedef {import('../types').GetRankCover} GetRankCover */ |
| 25 | + |
| 26 | +/** |
| 27 | + * @typedef {object} MatchHelper |
| 28 | + * This factors out only the parts specific to each kind of Matcher. It is |
| 29 | + * encapsulated, and its methods can make the stated unchecked assumptions |
| 30 | + * enforced by the common calling logic. |
| 31 | + * |
| 32 | + * @property {(allegedPayload: Passable, |
| 33 | + * check: Checker |
| 34 | + * ) => boolean} checkIsWellFormed |
| 35 | + * Reports whether `allegedPayload` is valid as the payload of a CopyTagged |
| 36 | + * whose tag corresponds with this MatchHelper's Matchers. |
| 37 | + * |
| 38 | + * @property {(specimen: Passable, |
| 39 | + * matcherPayload: Passable, |
| 40 | + * check: Checker, |
| 41 | + * ) => boolean} checkMatches |
| 42 | + * Assuming validity of `matcherPayload` as the payload of a Matcher corresponding |
| 43 | + * with this MatchHelper, reports whether `specimen` is matched by that Matcher. |
| 44 | + * |
| 45 | + * @property {import('../types').GetRankCover} getRankCover |
| 46 | + * Assumes this is the payload of a CopyTagged with the corresponding |
| 47 | + * matchTag. Return a RankCover to bound from below and above, |
| 48 | + * in rank order, all possible Passables that would match this Matcher. |
| 49 | + * The left element must be before or the same rank as any possible |
| 50 | + * matching specimen. The right element must be after or the same |
| 51 | + * rank as any possible matching specimen. |
| 52 | + */ |
| 53 | + |
| 54 | +/** |
| 55 | + * @typedef {object} PatternKit |
| 56 | + * @property {(specimen: Passable, |
| 57 | + * patt: Passable, |
| 58 | + * check: Checker, |
| 59 | + * label?: string|number |
| 60 | + * ) => boolean} checkMatches |
| 61 | + * @property {(specimen: Passable, patt: Pattern) => boolean} matches |
| 62 | + * @property {(specimen: Passable, patt: Pattern, label?: string|number) => void} mustMatch |
| 63 | + * @property {(patt: Pattern) => void} assertPattern |
| 64 | + * @property {(patt: Passable) => boolean} isPattern |
| 65 | + * @property {GetRankCover} getRankCover |
| 66 | + * @property {MatcherNamespace} M |
| 67 | + */ |
0 commit comments