primevue-mirror/components/lib/card/Card.d.ts

166 lines
3.8 KiB
TypeScript
Raw Normal View History

2023-02-28 14:44:35 +00:00
/**
*
* Card is a flexible container component.
*
* [Live Demo](https://www.primevue.org/card/)
*
* @module card
*
*/
2022-09-06 12:03:37 +00:00
import { VNode } from 'vue';
2023-07-06 11:17:08 +00:00
import { ComponentHooks } from '../basecomponent';
2023-09-05 08:50:46 +00:00
import { PassThroughOptions } from '../passthrough';
import { ClassComponent, DesignToken, GlobalComponentConstructor, PassThrough } from '../ts-helpers';
2022-09-06 12:03:37 +00:00
2024-02-20 08:16:34 +00:00
export declare type CardPassThroughOptionType = CardPassThroughAttributes | ((options: CardPassThroughMethodOptions) => CardPassThroughAttributes | string) | string | null | undefined;
/**
* Custom passthrough(pt) option method.
*/
export interface CardPassThroughMethodOptions {
/**
* Defines instance.
*/
instance: any;
/**
* Defines valid properties.
*/
props: CardProps;
/**
* Defines valid attributes.
*/
attrs: any;
/**
* Defines passthrough(pt) options in global config.
*/
global: object | undefined;
}
2023-03-24 13:15:30 +00:00
/**
* Custom passthrough(pt) options.
* @see {@link CardProps.pt}
*/
export interface CardPassThroughOptions {
/**
2024-05-15 09:22:27 +00:00
* Used to pass attributes to the roots DOM element.
2023-03-24 13:15:30 +00:00
*/
root?: CardPassThroughOptionType;
2023-03-31 12:55:51 +00:00
/**
2024-05-15 09:22:27 +00:00
* Used to pass attributes to the headers DOM element.
2023-03-31 12:55:51 +00:00
*/
header?: CardPassThroughOptionType;
2023-03-24 13:15:30 +00:00
/**
2024-05-15 09:22:27 +00:00
* Used to pass attributes to the bodys DOM element.
2023-03-24 13:15:30 +00:00
*/
body?: CardPassThroughOptionType;
/**
2024-05-15 09:22:27 +00:00
* Used to pass attributes to the captions DOM element.
*/
caption?: CardPassThroughOptionType;
2023-03-24 13:15:30 +00:00
/**
2024-05-15 09:22:27 +00:00
* Used to pass attributes to the titles DOM element.
2023-03-24 13:15:30 +00:00
*/
title?: CardPassThroughOptionType;
/**
2024-05-15 09:22:27 +00:00
* Used to pass attributes to the subtitles DOM element.
2023-03-24 13:15:30 +00:00
*/
subtitle?: CardPassThroughOptionType;
/**
2024-05-15 09:22:27 +00:00
* Used to pass attributes to the contents DOM element.
2023-03-24 13:15:30 +00:00
*/
content?: CardPassThroughOptionType;
/**
2024-05-15 09:22:27 +00:00
* Used to pass attributes to the footers DOM element.
2023-03-24 13:15:30 +00:00
*/
footer?: CardPassThroughOptionType;
2023-07-06 11:09:01 +00:00
/**
2023-11-07 06:16:39 +00:00
* Used to manage all lifecycle hooks.
2023-07-06 11:09:01 +00:00
* @see {@link BaseComponent.ComponentHooks}
*/
hooks?: ComponentHooks;
2023-03-24 13:15:30 +00:00
}
/**
* Custom passthrough attributes for each DOM elements
*/
export interface CardPassThroughAttributes {
[key: string]: any;
}
2023-03-03 14:16:05 +00:00
/**
* Defines valid properties in Card component.
*/
2023-03-24 13:15:30 +00:00
export interface CardProps {
/**
* It generates scoped CSS variables using design tokens for the component.
*/
dt?: DesignToken<any>;
2023-03-24 13:15:30 +00:00
/**
2023-08-01 14:01:12 +00:00
* Used to pass attributes to DOM elements inside the component.
2023-03-24 13:15:30 +00:00
* @type {CardPassThroughOptions}
*/
pt?: PassThrough<CardPassThroughOptions>;
2023-09-05 08:50:46 +00:00
/**
* Used to configure passthrough(pt) options of the component.
* @type {PassThroughOptions}
*/
ptOptions?: PassThroughOptions;
2023-05-22 22:03:28 +00:00
/**
* When enabled, it removes component related styles in the core.
* @defaultValue false
*/
unstyled?: boolean;
2023-03-24 13:15:30 +00:00
}
2022-09-06 12:03:37 +00:00
2023-03-03 14:16:05 +00:00
/**
* Defines valid slots in Card component.
*/
2022-09-06 12:03:37 +00:00
export interface CardSlots {
/**
* Custom header template.
*/
2023-02-28 14:44:35 +00:00
header(): VNode[];
2022-09-06 12:03:37 +00:00
/**
* Custom title template.
*/
2023-02-28 14:44:35 +00:00
title(): VNode[];
2022-09-06 12:03:37 +00:00
/**
* Custom subtitle template.
*/
2023-02-28 14:44:35 +00:00
subtitle(): VNode[];
2022-09-06 12:03:37 +00:00
/**
* Custom content template.
*/
2023-02-28 14:44:35 +00:00
content(): VNode[];
2022-09-06 12:03:37 +00:00
/**
* Custom footer template.
*/
2023-02-28 14:44:35 +00:00
footer(): VNode[];
2022-09-06 12:03:37 +00:00
}
2023-02-28 14:44:35 +00:00
/**
2023-03-03 14:16:05 +00:00
* Defines valid emits in Card component.
2023-02-28 14:44:35 +00:00
*/
2023-03-03 14:16:05 +00:00
export interface CardEmits {}
2022-09-06 12:03:37 +00:00
2023-02-28 14:44:35 +00:00
/**
* **PrimeVue - Card**
*
* _Card is a flexible container component._
*
* [Live Demo](https://www.primevue.org/card/)
* --- ---
2023-03-03 10:55:20 +00:00
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo-100.png)
2023-02-28 14:44:35 +00:00
*
* @group Component
*/
2023-03-01 12:30:54 +00:00
declare class Card extends ClassComponent<CardProps, CardSlots, CardEmits> {}
2022-09-06 12:03:37 +00:00
declare module 'vue' {
export interface GlobalComponents {
2022-09-14 11:26:01 +00:00
Card: GlobalComponentConstructor<Card>;
2022-09-06 12:03:37 +00:00
}
}
export default Card;