Skip to content

Commit

Permalink
refactor(store): fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
erights committed Apr 15, 2023
1 parent 8b237f1 commit 227bc19
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/ERTP/src/paymentLedger.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const { details: X, quote: q, Fail } = assert;
/**
* @param {Brand} brand
* @param {AssetKind} assetKind
* @param {Matcher} elementShape
* @param {Pattern} elementShape
*/
const amountShapeFromElementShape = (brand, assetKind, elementShape) => {
let valueShape;
Expand Down
60 changes: 60 additions & 0 deletions packages/store/src/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
/** @template T @typedef {import('@endo/marshal').CopyArray<T>} CopyArray */
/** @typedef {import('@endo/marshal').Checker} Checker */
/** @typedef {import('@endo/marshal/src/rankOrder').RankCompare} RankCompare */
/** @typedef {import('@endo/marshal/src/rankOrder').RankComparison} RankComparison */

// /////////////////////////////////////////////////////////////////////////////
// Placeholder redundant types, to be imported from `@endo/patterns` instead.

/**
* @typedef {Passable} Key
Expand All @@ -27,6 +31,15 @@
* TODO placeholder. Figure out how to import from `@endo/patterns` instead
*/

/**
* @template {Key} [K=Key]
* @typedef {CopyTagged & {
* [Symbol.toStringTag]: 'copyBag',
* payload: Array<[K, bigint]>,
* }} CopyBag
* TODO placeholder. Figure out how to import from `@endo/patterns` instead
*/

/**
* @template {Key} [K=Key]
* @template {Passable} [V=Passable]
Expand All @@ -37,6 +50,53 @@
* TODO placeholder. Figure out how to import from `@endo/patterns` instead
*/

/**
* @typedef {object} GuardMakers
* @property {<M extends Record<any, any>>(interfaceName: string,
* methodGuards: M,
* options?: {sloppy?: boolean}
* ) => InterfaceGuard} interface
* TODO placeholder. Figure out how to import from `@endo/patterns` instead
*
* @property {(...argGuards: ArgGuard[]) => MethodGuardMaker} call Guard a synchronous call
*
* @property {(...argGuards: ArgGuard[]) => MethodGuardMaker} callWhen Guard an async call
*
* @property {(argGuard: ArgGuard) => ArgGuard} await Guard an await
*/

/**
* @typedef {(...args: any[]) => any} Method
* TODO placeholder. Figure out how to import from `@endo/patterns` instead
*/

/**
* @typedef {{
* klass: 'Interface',
* interfaceName: string,
* methodGuards: Record<string | symbol, MethodGuard>
* sloppy?: boolean
* }} InterfaceGuard
* TODO placeholder. Figure out how to import from `@endo/patterns` instead
*/

/**
* @typedef {any} MethodGuardMaker
* TODO placeholder. Figure out how to import from `@endo/patterns` instead
*/

/**
* @typedef {{ klass: 'methodGuard', callKind: 'sync' | 'async', returnGuard: unknown }} MethodGuard
* TODO placeholder. Figure out how to import from `@endo/patterns` instead
*/

/**
* @typedef {any} ArgGuard
* TODO placeholder. Figure out how to import from `@endo/patterns` instead
*/

// /////////////////////////////////////////////////////////////////////////////

/**
* @typedef {object} StoreOptions
* Of the dimensions on which KeyedStores can differ, we only represent a few
Expand Down
2 changes: 1 addition & 1 deletion packages/zoe/src/contractSupport/recorder.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ export const prepareMockRecorderKitMakers = () => {
* explictly specify the type that the Pattern will verify through a match.
*
* @template T
* @typedef {Matcher & {validatedType?: T}} TypedMatcher
* @typedef {Pattern & {validatedType?: T}} TypedMatcher
*/

/**
Expand Down

0 comments on commit 227bc19

Please sign in to comment.