keyed.d.ts 903 B

1234567891011121314151617181920212223
  1. /**
  2. * @license
  3. * Copyright 2021 Google LLC
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. import { Directive, ChildPart, DirectiveParameters } from '../directive.js';
  7. declare class Keyed extends Directive {
  8. key: unknown;
  9. render(k: unknown, v: unknown): unknown;
  10. update(part: ChildPart, [k, v]: DirectiveParameters<this>): unknown;
  11. }
  12. /**
  13. * Associates a renderable value with a unique key. When the key changes, the
  14. * previous DOM is removed and disposed before rendering the next value, even
  15. * if the value - such as a template - is the same.
  16. *
  17. * This is useful for forcing re-renders of stateful components, or working
  18. * with code that expects new data to generate new HTML elements, such as some
  19. * animation techniques.
  20. */
  21. export declare const keyed: (k: unknown, v: unknown) => import("../directive.js").DirectiveResult<typeof Keyed>;
  22. export {};
  23. //# sourceMappingURL=keyed.d.ts.map