Skip to content

Commit

Permalink
Refactor #3965 - For Directives .d.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed Jun 23, 2023
1 parent 7cb1814 commit 8268c74
Show file tree
Hide file tree
Showing 6 changed files with 646 additions and 616 deletions.
75 changes: 39 additions & 36 deletions components/lib/badgedirective/BadgeDirective.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,45 @@
*/
import { DirectiveBinding, ObjectDirective } from 'vue';

/**
* Defines options of Badge.
*/
export interface BadgeOptions {
/**
* Uses to pass attributes to DOM elements inside the component.
* @type {BadgePassThroughOptions}
*/
pt?: BadgePassThroughOptions;
}

/**
* Custom passthrough(pt) options.
* @see {@link BadgeOptions.pt}
*/
export interface BadgePassThroughOptions {
/**
* Uses to pass attributes to the root's DOM element.
* @see {@link BadgePassThroughDirectiveOptions}
*/
root?: BadgePassThroughDirectiveOptions;
}

/**
* Custom passthrough(pt) directive options.
*/
export interface BadgePassThroughDirectiveOptions {
/**
* Uses to pass attributes to the life cycle hooks.
* @see {@link BadgePassThroughHooksOptions}
*/
hooks?: BadgePassThroughHooksOptions;
/**
* Uses to pass attributes to the styles.
* @see {@link BadgePassThroughCSSOptions}
*/
css?: BadgePassThroughCSSOptions;
}

/**
* Custom passthrough(pt) hooks options.
*/
Expand Down Expand Up @@ -56,42 +95,6 @@ export interface BadgePassThroughCSSOptions {
style?: any;
}

export interface BadgePassThroughDirectiveOptions {
/**
* Uses to pass attributes to the life cycle hooks.
* @see {@link BadgePassThroughHooksOptions}
*/
hooks?: BadgePassThroughHooksOptions;
/**
* Uses to pass attributes to the styles.
* @see {@link BadgePassThroughCSSOptions}
*/
css?: BadgePassThroughCSSOptions;
}

/**
* Custom passthrough(pt) options.
* @see {@link BadgeOptions.pt}
*/
export interface BadgePassThroughOptions {
/**
* Uses to pass attributes to the root's DOM element.
* @see {@link BadgePassThroughDirectiveOptions}
*/
root?: BadgePassThroughDirectiveOptions;
}

/**
* Defines options of Badge.
*/
export interface BadgeOptions {
/**
* Uses to pass attributes to DOM elements inside the component.
* @type {BadgePassThroughOptions}
*/
pt?: BadgePassThroughOptions;
}

/**
* Defines modifiers of Badge directive.
*/
Expand Down
113 changes: 58 additions & 55 deletions components/lib/focustrap/FocusTrap.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,53 +9,51 @@
import { DirectiveBinding, ObjectDirective } from 'vue';

/**
* Custom passthrough(pt) hooks options.
* Defines options of FocusTrap.
*/
export interface FocusTrapPassThroughHooksOptions {
/**
* Called before bound element's attributes or event listeners are applied.
*/
created?: DirectiveBinding;
/**
* Called right before the element is inserted into the DOM.
*/
beforeMount?: DirectiveBinding;
/**
* Called when the bound element's parent component and all its children are mounted.
*/
mounted?: DirectiveBinding;
/**
* Called before the parent component is updated.
*/
beforeUpdate?: DirectiveBinding;
export interface FocusTrapOptions {
/**
* Called after the parent component and all of its children have updated all of its children have updated.
* When present, it specifies that the directive should be disabled.
* @defaultValue false
*/
updated?: DirectiveBinding;
disabled?: boolean | undefined;
/**
* Called before the parent component is unmounted.
* When When disabled, focustrap will not focus by default.
* @defaultValue true
*/
beforeUnmount?: DirectiveBinding;
autoFocus?: boolean | undefined;
/**
* Called when the parent component is unmounted.
* Uses to pass attributes to DOM elements inside the component.
* @type {FocusTrapPassThroughOptions}
*/
unmounted?: DirectiveBinding;
pt?: FocusTrapPassThroughOptions;
}

/**
* Custom passthrough(pt) css options.
* Custom passthrough(pt) options.
* @see {@link FocusTrapOptions.pt}
*/
export interface FocusTrapPassThroughCSSOptions {
export interface FocusTrapPassThroughOptions {
/**
* Style class of the element.
* Uses to pass attributes to the root's DOM element.
* @see {@link FocusTrapPassThroughDirectiveOptions}
*/
class?: any;
root?: FocusTrapPassThroughDirectiveOptions;
/**
* Inline style of the element.
* Uses to pass attributes to the first focusable element's DOM element.
* @see {@link FocusTrapPassThroughDirectiveOptions}
*/
style?: any;
firstFocusableElement?: FocusTrapPassThroughDirectiveOptions;
/**
* Uses to pass attributes to the last focusable element's DOM element.
* @see {@link FocusTrapPassThroughDirectiveOptions}
*/
lastFocusableElement?: FocusTrapPassThroughDirectiveOptions;
}

/**
* Custom passthrough(pt) directive options.
*/
export interface FocusTrapPassThroughDirectiveOptions {
/**
* Uses to pass attributes to the life cycle hooks.
Expand All @@ -70,46 +68,51 @@ export interface FocusTrapPassThroughDirectiveOptions {
}

/**
* Custom passthrough(pt) options.
* @see {@link FocusTrapOptions.pt}
* Custom passthrough(pt) hooks options.
*/
export interface FocusTrapPassThroughOptions {
export interface FocusTrapPassThroughHooksOptions {
/**
* Uses to pass attributes to the root's DOM element.
* @see {@link FocusTrapPassThroughDirectiveOptions}
* Called before bound element's attributes or event listeners are applied.
*/
root?: FocusTrapPassThroughDirectiveOptions;
created?: DirectiveBinding;
/**
* Uses to pass attributes to the first focusable element's DOM element.
* @see {@link FocusTrapPassThroughDirectiveOptions}
* Called right before the element is inserted into the DOM.
*/
firstFocusableElement?: FocusTrapPassThroughDirectiveOptions;
beforeMount?: DirectiveBinding;
/**
* Uses to pass attributes to the last focusable element's DOM element.
* @see {@link FocusTrapPassThroughDirectiveOptions}
* Called when the bound element's parent component and all its children are mounted.
*/
lastFocusableElement?: FocusTrapPassThroughDirectiveOptions;
mounted?: DirectiveBinding;
/**
* Called before the parent component is updated.
*/
beforeUpdate?: DirectiveBinding;
/**
* Called after the parent component and all of its children have updated all of its children have updated.
*/
updated?: DirectiveBinding;
/**
* Called before the parent component is unmounted.
*/
beforeUnmount?: DirectiveBinding;
/**
* Called when the parent component is unmounted.
*/
unmounted?: DirectiveBinding;
}

/**
* Defines options of FocusTrap.
* Custom passthrough(pt) css options.
*/
export interface FocusTrapOptions {
/**
* When present, it specifies that the directive should be disabled.
* @defaultValue false
*/
disabled?: boolean | undefined;
export interface FocusTrapPassThroughCSSOptions {
/**
* When When disabled, focustrap will not focus by default.
* @defaultValue true
* Style class of the element.
*/
autoFocus?: boolean | undefined;
class?: any;
/**
* Uses to pass attributes to DOM elements inside the component.
* @type {FocusTrapPassThroughOptions}
* Inline style of the element.
*/
pt?: FocusTrapPassThroughOptions;
style?: any;
}

/**
Expand Down
75 changes: 39 additions & 36 deletions components/lib/ripple/Ripple.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,45 @@
*/
import { DirectiveBinding, ObjectDirective } from 'vue';

/**
* Defines options of Ripple.
*/
export interface RippleOptions {
/**
* Uses to pass attributes to DOM elements inside the component.
* @type {RipplePassThroughOptions}
*/
pt?: RipplePassThroughOptions;
}

/**
* Custom passthrough(pt) options.
* @see {@link RippleOptions.pt}
*/
export interface RipplePassThroughOptions {
/**
* Uses to pass attributes to the root's DOM element.
* @see {@link RipplePassThroughDirectiveOptions}
*/
root?: RipplePassThroughDirectiveOptions;
}

/**
* Custom passthrough(pt) directive options.
*/
export interface RipplePassThroughDirectiveOptions {
/**
* Uses to pass attributes to the life cycle hooks.
* @see {@link RipplePassThroughHooksOptions}
*/
hooks?: RipplePassThroughHooksOptions;
/**
* Uses to pass attributes to the styles.
* @see {@link RipplePassThroughCSSOptions}
*/
css?: RipplePassThroughCSSOptions;
}

/**
* Custom passthrough(pt) hooks options.
*/
Expand Down Expand Up @@ -56,42 +95,6 @@ export interface RipplePassThroughCSSOptions {
style?: any;
}

export interface RipplePassThroughDirectiveOptions {
/**
* Uses to pass attributes to the life cycle hooks.
* @see {@link RipplePassThroughHooksOptions}
*/
hooks?: RipplePassThroughHooksOptions;
/**
* Uses to pass attributes to the styles.
* @see {@link RipplePassThroughCSSOptions}
*/
css?: RipplePassThroughCSSOptions;
}

/**
* Custom passthrough(pt) options.
* @see {@link RippleOptions.pt}
*/
export interface RipplePassThroughOptions {
/**
* Uses to pass attributes to the root's DOM element.
* @see {@link RipplePassThroughDirectiveOptions}
*/
root?: RipplePassThroughDirectiveOptions;
}

/**
* Defines options of Ripple.
*/
export interface RippleOptions {
/**
* Uses to pass attributes to DOM elements inside the component.
* @type {RipplePassThroughOptions}
*/
pt?: RipplePassThroughOptions;
}

/**
* Binding of Ripple directive.
*/
Expand Down
Loading

0 comments on commit 8268c74

Please sign in to comment.