|
| 1 | +declare namespace BemSDK { |
| 2 | + export namespace EntityName { |
| 3 | + /** |
| 4 | + * Types of BEM entities. |
| 5 | + */ |
| 6 | + export type TYPE = 'block' | 'blockMod' | 'elem' | 'elemMod'; |
| 7 | + |
| 8 | + /** |
| 9 | + * Abstract object to represent entity name |
| 10 | + */ |
| 11 | + interface AbstractEntityRepresentation { |
| 12 | + /** |
| 13 | + * The block name of entity. |
| 14 | + */ |
| 15 | + block: string; |
| 16 | + /** |
| 17 | + * The element name of entity. |
| 18 | + */ |
| 19 | + elem?: string; |
| 20 | + mod?: any; |
| 21 | + } |
| 22 | + |
| 23 | + /** |
| 24 | + * Object to represent modifier of entity name. |
| 25 | + */ |
| 26 | + export interface ModifierRepresentation { |
| 27 | + /** |
| 28 | + * The modifier name of entity. |
| 29 | + */ |
| 30 | + name: string; |
| 31 | + /** |
| 32 | + * The modifier value of entity. |
| 33 | + */ |
| 34 | + val: string | true; |
| 35 | + } |
| 36 | + |
| 37 | + /** |
| 38 | + * Strict object to represent entity name. |
| 39 | + */ |
| 40 | + export interface StrictRepresentation extends AbstractEntityRepresentation { |
| 41 | + /** |
| 42 | + * The modifier of entity. |
| 43 | + */ |
| 44 | + mod?: ModifierRepresentation; |
| 45 | + } |
| 46 | + |
| 47 | + /** |
| 48 | + * Object to create representation of entity name. |
| 49 | + */ |
| 50 | + export interface Options extends AbstractEntityRepresentation { |
| 51 | + /** |
| 52 | + * The modifier of entity. |
| 53 | + */ |
| 54 | + mod?: string | { |
| 55 | + /** |
| 56 | + * The modifier name of entity. |
| 57 | + */ |
| 58 | + name: string; |
| 59 | + /** |
| 60 | + * The modifier value of entity. |
| 61 | + */ |
| 62 | + val?: string | boolean; |
| 63 | + }; |
| 64 | + /** |
| 65 | + * The modifier name of entity. Used if `mod.name` wasn't specified. |
| 66 | + * @deprecated use `mod.name` instead. |
| 67 | + */ |
| 68 | + modName?: string; |
| 69 | + /** |
| 70 | + * The modifier value of entity. Used if neither `mod.val` nor `val` were not specified. |
| 71 | + * @deprecated use `mod.name` instead. |
| 72 | + */ |
| 73 | + modVal?: string; |
| 74 | + } |
| 75 | + |
| 76 | + /** |
| 77 | + * Non-strict object to represent entity name. |
| 78 | + * |
| 79 | + * Contains old field: `val`, `modName` and `modVal. |
| 80 | + */ |
| 81 | + export interface NonStrictRepresentation extends AbstractEntityRepresentation { |
| 82 | + /** |
| 83 | + * The modifier of entity. |
| 84 | + */ |
| 85 | + mod?: string | { |
| 86 | + /** |
| 87 | + * The modifier name of entity. |
| 88 | + */ |
| 89 | + name: string; |
| 90 | + /** |
| 91 | + * The modifier value of entity. |
| 92 | + */ |
| 93 | + val?: string | boolean; |
| 94 | + }; |
| 95 | + /** |
| 96 | + * The modifier value of entity. Used if neither `mod.val` were not specified. |
| 97 | + */ |
| 98 | + val?: string; |
| 99 | + /** |
| 100 | + * The modifier name of entity. Used if `mod.name` wasn't specified. |
| 101 | + */ |
| 102 | + modName?: string; |
| 103 | + /** |
| 104 | + * The modifier value of entity. Used if neither `mod.val` nor `val` were not specified. |
| 105 | + */ |
| 106 | + modVal?: string; |
| 107 | + } |
| 108 | + } |
| 109 | +} |
0 commit comments