Files
SnowLuma/.pnpm-store/v11/files/18/d720b5398c7a47ef02d67c1494f5fd382511c3a861b246c41e21ebfe1490760a5c49c574fc6f12b6a08d66fdba9c5aa785a952e437b59932e6df302cd07239
T
TanTan 2a69b23b47
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

56 lines
1.8 KiB
Plaintext

import { NgCompInputs, NgGridStackWidget } from './types';
import * as i0 from "@angular/core";
/**
* Base widget class for GridStack Angular integration.
*/
export declare abstract class BaseWidget {
/**
* Complete widget definition including position, size, and Angular-specific data.
* Populated automatically when the widget is loaded or saved.
*/
widgetItem?: NgGridStackWidget;
/**
* Override this method to return serializable data for this widget.
*
* Return an object with properties that map to your component's @Input() fields.
* The selector is handled automatically, so only include component-specific data.
*
* @returns Object containing serializable component data
*
* @example
* ```typescript
* serialize() {
* return {
* title: this.title,
* value: this.value,
* settings: this.settings
* };
* }
* ```
*/
serialize(): NgCompInputs | undefined;
/**
* Override this method to handle widget restoration from saved data.
*
* Use this for complex initialization that goes beyond simple @Input() mapping.
* The default implementation automatically assigns input data to component properties.
*
* @param w The saved widget data including input properties
*
* @example
* ```typescript
* deserialize(w: NgGridStackWidget) {
* super.deserialize(w); // Call parent for basic setup
*
* // Custom initialization logic
* if (w.input?.complexData) {
* this.processComplexData(w.input.complexData);
* }
* }
* ```
*/
deserialize(w: NgGridStackWidget): void;
static ɵfac: i0.ɵɵFactoryDeclaration<BaseWidget, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<BaseWidget>;
}