state sync

This commit is contained in:
2025-11-23 14:59:17 -08:00
parent 537bdf1ad7
commit 39f4a8d3fc
812 changed files with 373062 additions and 84 deletions

View File

@@ -0,0 +1,24 @@
import type { DiagramDB } from '../../diagram-api/types.js';
import type { PacketWord } from './types.js';
export declare class PacketDB implements DiagramDB {
private packet;
getConfig(): {
rowHeight: number;
bitWidth: number;
bitsPerRow: number;
showBits: boolean;
paddingX: number;
paddingY: number;
useWidth: number;
useMaxWidth: boolean;
};
getPacket(): PacketWord[];
pushWord(word: PacketWord): void;
clear(): void;
setAccTitle: (txt: string) => void;
getAccTitle: () => string;
setDiagramTitle: (txt: string) => void;
getDiagramTitle: () => string;
getAccDescription: () => string;
setAccDescription: (txt: string) => void;
}

View File

@@ -0,0 +1,2 @@
import type { ExternalDiagramDefinition } from '../../diagram-api/types.js';
export declare const packet: ExternalDiagramDefinition;

View File

@@ -0,0 +1,2 @@
import type { DiagramDefinition } from '../../diagram-api/types.js';
export declare const diagram: DiagramDefinition;

View File

@@ -0,0 +1 @@
export {};

View File

@@ -0,0 +1,2 @@
import type { ParserDefinition } from '../../diagram-api/types.js';
export declare const parser: ParserDefinition;

View File

@@ -0,0 +1,2 @@
import type { DiagramRenderer } from '../../diagram-api/types.js';
export declare const renderer: DiagramRenderer;

View File

@@ -0,0 +1,3 @@
import type { DiagramStylesProvider } from '../../diagram-api/types.js';
export declare const styles: DiagramStylesProvider;
export default styles;

View File

@@ -0,0 +1,25 @@
import type { Packet, RecursiveAstOmit } from '@mermaid-js/parser';
import type { PacketDiagramConfig } from '../../config.type.js';
import type { DiagramDBBase } from '../../diagram-api/types.js';
import type { ArrayElement } from '../../types.js';
export type PacketBlock = RecursiveAstOmit<ArrayElement<Packet['blocks']>>;
export type PacketWord = Required<PacketBlock>[];
export interface PacketDB extends DiagramDBBase<PacketDiagramConfig> {
pushWord: (word: PacketWord) => void;
getPacket: () => PacketWord[];
}
export interface PacketStyleOptions {
byteFontSize?: string;
startByteColor?: string;
endByteColor?: string;
labelColor?: string;
labelFontSize?: string;
blockStrokeColor?: string;
blockStrokeWidth?: string;
blockFillColor?: string;
titleColor?: string;
titleFontSize?: string;
}
export interface PacketData {
packet: PacketWord[];
}