attr.d.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. export declare const CASE_SENSITIVE_ATTR: string[];
  2. export type Attributes = {
  3. [key: string]: string | number | null | undefined;
  4. };
  5. export declare function getAttribute(elem: Element, name: string): string | null;
  6. export declare function removeAttribute(elem: Element, name: string): void;
  7. export declare function setAttribute(elem: Element, name: string, value?: string | number | null | undefined): void;
  8. export declare function setAttributes(elem: Element, attrs: {
  9. [attr: string]: string | number | null | undefined;
  10. }): void;
  11. export declare function attr(elem: Element): {
  12. [attr: string]: string;
  13. };
  14. export declare function attr(elem: Element, name: string): string;
  15. export declare function attr(elem: Element, attrs: {
  16. [attr: string]: string | number | null | undefined;
  17. }): void;
  18. export declare function attr(elem: Element, name: string, value: string | number | null | undefined): void;
  19. export declare function qualifyAttr(name: string): {
  20. ns: any;
  21. local: string;
  22. };
  23. export declare function kebablizeAttrs(attrs: Attributes): Attributes;
  24. export declare function styleToObject(styleString: string): {
  25. [name: string]: string;
  26. };
  27. export declare function mergeAttrs(target: {
  28. [attr: string]: any;
  29. }, source: {
  30. [attr: string]: any;
  31. }): {
  32. [attr: string]: any;
  33. };