@atproto/lexicon 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,9 @@ export declare class Lexicons {
7
7
  remove(uri: string): void;
8
8
  get(uri: string): LexiconDoc | undefined;
9
9
  getDef(uri: string): LexUserType | undefined;
10
- getDefOrThrow(uri: string, types?: string[]): LexUserType;
10
+ getDefOrThrow<T extends LexUserType['type'] = LexUserType['type']>(uri: string, types?: readonly T[]): Extract<LexUserType, {
11
+ type: T;
12
+ }>;
11
13
  validate(lexUri: string, value: unknown): ValidationResult;
12
14
  assertValidRecord(lexUri: string, value: unknown): unknown;
13
15
  assertValidXrpcParams(lexUri: string, value: unknown): unknown;
@@ -1,9 +1,9 @@
1
1
  import { IpldValue, JsonValue } from '@atproto/common-web';
2
2
  import { BlobRef } from './blob-refs';
3
- export declare type LexValue = IpldValue | BlobRef | Array<LexValue> | {
3
+ export type LexValue = IpldValue | BlobRef | Array<LexValue> | {
4
4
  [key: string]: LexValue;
5
5
  };
6
- export declare type RepoRecord = Record<string, LexValue>;
6
+ export type RepoRecord = Record<string, LexValue>;
7
7
  export declare const lexToIpld: (val: LexValue) => IpldValue;
8
8
  export declare const ipldToLex: (val: IpldValue) => LexValue;
9
9
  export declare const lexToJson: (val: LexValue) => JsonValue;