Sin descripción

set.d.ts 1.1KB

123456789101112131415161718192021222324252627
  1. import type { Schema } from '../../schema/Schema.js';
  2. import { Pair } from '../../nodes/Pair.js';
  3. import { Scalar } from '../../nodes/Scalar.js';
  4. import { ToJSContext } from '../../nodes/toJS.js';
  5. import { YAMLMap } from '../../nodes/YAMLMap.js';
  6. import type { StringifyContext } from '../../stringify/stringify.js';
  7. import type { CollectionTag } from '../types.js';
  8. export declare class YAMLSet<T = unknown> extends YAMLMap<T, Scalar<null> | null> {
  9. static tag: string;
  10. constructor(schema?: Schema);
  11. add(key: T | Pair<T, Scalar<null> | null> | {
  12. key: T;
  13. value: Scalar<null> | null;
  14. }): void;
  15. /**
  16. * If `keepPair` is `true`, returns the Pair matching `key`.
  17. * Otherwise, returns the value of that Pair's key.
  18. */
  19. get(key: unknown, keepPair?: boolean): any;
  20. set(key: T, value: boolean): void;
  21. /** @deprecated Will throw; `value` must be boolean */
  22. set(key: T, value: null): void;
  23. toJSON(_?: unknown, ctx?: ToJSContext): any;
  24. toString(ctx?: StringifyContext, onComment?: () => void, onChompKeep?: () => void): string;
  25. }
  26. export declare const set: CollectionTag;