UNPKG

aspen-decorations

Version:

Complex styling for react-aspen w/ inheritance and negations

39 lines (38 loc) 2.09 kB
import { Directory, FileEntry } from 'aspen-core'; import { IDisposable } from 'notificar'; import { TargetMatchMode } from './types'; export declare class Decoration { /** * Do not mutate directly, use `Decoration#addCSSClass()` / `Decoration#removeCSSClass` instead */ readonly cssClasslist: Set<string>; private _appliedTargetsDisposables; private _negatedTargetsDisposables; private _appliedTargets; private _negatedTargets; private _disabled; private events; constructor(); constructor(...cssClasslist: string[]); disabled: boolean; readonly appliedTargets: Map<FileEntry | Directory, TargetMatchMode>; readonly negatedTargets: Map<FileEntry | Directory, TargetMatchMode>; addCSSClass(classname: string): void; removeCSSClass(classname: string): void; addTarget(directory: Directory, flags: TargetMatchMode): void; addTarget(file: FileEntry): void; removeTarget(directory: Directory): void; removeTarget(file: FileEntry): void; negateTarget(directory: Directory, flags: TargetMatchMode): void; negateTarget(file: FileEntry): void; unNegateTarget(directory: Directory): void; unNegateTarget(file: FileEntry): void; onDidAddTarget(callback: (decoration: Decoration, target: FileEntry | Directory, flags: TargetMatchMode) => void): IDisposable; onDidRemoveTarget(callback: (decoration: Decoration, target: FileEntry | Directory) => void): IDisposable; onDidNegateTarget(callback: (decoration: Decoration, target: FileEntry | Directory, flags: TargetMatchMode) => void): IDisposable; onDidUnNegateTarget(callback: (decoration: Decoration, target: FileEntry | Directory) => void): IDisposable; onDidRemoveCSSClassname(callback: (decoration: Decoration, classname: string) => void): IDisposable; onDidAddCSSClassname(callback: (decoration: Decoration, classname: string) => void): IDisposable; onDidEnableDecoration(callback: (decoration: Decoration) => void): IDisposable; onDidDisableDecoration(callback: (decoration: Decoration) => void): IDisposable; }