node_modules ignore

This commit is contained in:
2025-05-08 23:43:47 +02:00
parent e19d52f172
commit 4574544c9f
65041 changed files with 10593536 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
export declare const resetGroupIds: () => void;
export declare const getGroupForId: (id: string) => number;
export declare const getIdForGroup: (group: number) => void | string;
export declare const setGroupForId: (id: string, group: number) => void;

View File

@@ -0,0 +1,11 @@
import { Tag } from './types';
/** Create a GroupedTag with an underlying Tag implementation */
export declare const makeGroupedTag: (tag: Tag) => {
groupSizes: Uint32Array;
length: number;
tag: Tag;
indexOfGroup(group: number): number;
insertRules(group: number, rules: string[]): void;
clearGroup(group: number): void;
getGroup(group: number): string;
};

View File

@@ -0,0 +1,3 @@
import { Sheet } from './types';
export declare const outputSheet: (sheet: Sheet) => string;
export declare const rehydrateSheet: (sheet: Sheet) => void;

View File

@@ -0,0 +1,40 @@
import { InsertionTarget } from '../types';
import { GroupedTag, Sheet, SheetOptions } from './types';
type SheetConstructorArgs = {
isServer?: boolean;
useCSSOMInjection?: boolean;
target?: InsertionTarget | undefined;
};
type GlobalStylesAllocationMap = {
[key: string]: number;
};
type NamesAllocationMap = Map<string, Set<string>>;
/** Contains the main stylesheet logic for stringification and caching */
export default class StyleSheet implements Sheet {
gs: GlobalStylesAllocationMap;
names: NamesAllocationMap;
options: SheetOptions;
server: boolean;
tag?: GroupedTag | undefined;
/** Register a group ID to give it an index */
static registerId(id: string): number;
constructor(options?: SheetConstructorArgs, globalStyles?: GlobalStylesAllocationMap, names?: NamesAllocationMap | undefined);
rehydrate(): void;
reconstructWithOptions(options: SheetConstructorArgs, withNames?: boolean): StyleSheet;
allocateGSInstance(id: string): number;
/** Lazily initialises a GroupedTag for when it's actually needed */
getTag(): GroupedTag;
/** Check whether a name is known for caching */
hasNameForId(id: string, name: string): boolean;
/** Mark a group's name as known for caching */
registerName(id: string, name: string): void;
/** Insert new rules which also marks the name as known */
insertRules(id: string, name: string, rules: string | string[]): void;
/** Clears all cached names for a given group ID */
clearNames(id: string): void;
/** Clears all rules for a given group ID */
clearRules(id: string): void;
/** Clears the entire tag which deletes all rules but not its names */
clearTag(): void;
}
export {};

View File

@@ -0,0 +1,55 @@
import { InsertionTarget } from '../types';
import { SheetOptions } from './types';
/** Create a CSSStyleSheet-like tag depending on the environment */
export declare const makeTag: ({ isServer, useCSSOMInjection, target }: SheetOptions) => {
element: HTMLStyleElement;
sheet: CSSStyleSheet;
length: number;
insertRule(index: number, rule: string): boolean;
deleteRule(index: number): void;
getRule(index: number): string;
} | {
element: HTMLStyleElement;
nodes: NodeListOf<Node>;
length: number;
insertRule(index: number, rule: string): boolean;
deleteRule(index: number): void;
getRule(index: number): string;
} | {
rules: string[];
length: number;
insertRule(index: number, rule: string): boolean;
deleteRule(index: number): void;
getRule(index: number): string;
};
export declare const CSSOMTag: {
new (target?: InsertionTarget | undefined): {
element: HTMLStyleElement;
sheet: CSSStyleSheet;
length: number;
insertRule(index: number, rule: string): boolean;
deleteRule(index: number): void;
getRule(index: number): string;
};
};
/** A Tag that emulates the CSSStyleSheet API but uses text nodes */
export declare const TextTag: {
new (target?: InsertionTarget | undefined): {
element: HTMLStyleElement;
nodes: NodeListOf<Node>;
length: number;
insertRule(index: number, rule: string): boolean;
deleteRule(index: number): void;
getRule(index: number): string;
};
};
/** A completely virtual (server-side) Tag that doesn't manipulate the DOM */
export declare const VirtualTag: {
new (_target?: InsertionTarget | undefined): {
rules: string[];
length: number;
insertRule(index: number, rule: string): boolean;
deleteRule(index: number): void;
getRule(index: number): string;
};
};

View File

@@ -0,0 +1,5 @@
import { InsertionTarget } from '../types';
/** Create a style element inside `target` or <head> after the last */
export declare const makeStyleTag: (target?: InsertionTarget | undefined) => HTMLStyleElement;
/** Get the CSSStyleSheet instance for a given style element */
export declare const getSheet: (tag: HTMLStyleElement) => CSSStyleSheet;

View File

@@ -0,0 +1 @@
export { default } from './Sheet';

View File

@@ -0,0 +1,36 @@
import { InsertionTarget } from '../types';
/** CSSStyleSheet-like Tag abstraction for CSS rules */
export interface Tag {
insertRule(index: number, rule: string): boolean;
deleteRule(index: number): void;
getRule(index: number): string;
length: number;
}
/** Group-aware Tag that sorts rules by indices */
export interface GroupedTag {
clearGroup(group: number): void;
getGroup(group: number): string;
groupSizes: Uint32Array;
insertRules(group: number, rules: string | string[]): void;
length: number;
tag: Tag;
}
export type SheetOptions = {
isServer: boolean;
target?: InsertionTarget | undefined;
useCSSOMInjection: boolean;
};
export interface Sheet {
allocateGSInstance(id: string): number;
clearNames(id: string): void;
clearRules(id: string): void;
clearTag(): void;
getTag(): GroupedTag;
hasNameForId(id: string, name: string): boolean;
insertRules(id: string, name: string, rules: string | string[]): void;
options: SheetOptions;
names: Map<string, Set<string>>;
registerName(id: string, name: string): void;
rehydrate(): void;
toString(): string;
}