typescript-pdf
Advanced tools
+239
-35
@@ -349,2 +349,140 @@ declare class PdfStream { | ||
| declare enum FontWeight$1 { | ||
| Normal = "normal", | ||
| Bold = "bold" | ||
| } | ||
| declare enum FontStyle$1 { | ||
| Normal = "normal", | ||
| Italic = "italic" | ||
| } | ||
| declare enum TextDecorationStyle { | ||
| Solid = "solid", | ||
| Dashed = "dashed", | ||
| Dotted = "dotted", | ||
| Double = "double" | ||
| } | ||
| declare enum TextDecorationFlag { | ||
| None = 0, | ||
| Underline = 1, | ||
| Overline = 2, | ||
| LineThrough = 4 | ||
| } | ||
| declare class TextDecoration$1 { | ||
| private readonly _mask; | ||
| private constructor(); | ||
| static readonly none: TextDecoration$1; | ||
| static readonly underline: TextDecoration$1; | ||
| static readonly overline: TextDecoration$1; | ||
| static readonly lineThrough: TextDecoration$1; | ||
| static combine(decorations: TextDecoration$1[]): TextDecoration$1; | ||
| contains(other: TextDecoration$1): boolean; | ||
| merge(other?: TextDecoration$1): TextDecoration$1; | ||
| get hasUnderline(): boolean; | ||
| get hasOverline(): boolean; | ||
| get hasLineThrough(): boolean; | ||
| equals(other: TextDecoration$1): boolean; | ||
| } | ||
| interface TextStyle$1 { | ||
| inherit?: boolean; | ||
| color?: string; | ||
| fontFamily?: PdfStandardFont; | ||
| fontSize?: number; | ||
| fontWeight?: FontWeight$1; | ||
| fontStyle?: FontStyle$1; | ||
| letterSpacing?: number; | ||
| wordSpacing?: number; | ||
| lineSpacing?: number; | ||
| height?: number; | ||
| decoration?: TextDecoration$1; | ||
| decorationColor?: string; | ||
| decorationStyle?: TextDecorationStyle; | ||
| decorationThickness?: number; | ||
| } | ||
| declare const TextStyleUtils: { | ||
| createDefault(overrides?: Partial<Omit<TextStyle$1, "inherit">>): TextStyle$1; | ||
| createInheriting(overrides?: Partial<Omit<TextStyle$1, "inherit">>): TextStyle$1; | ||
| copyWith(style: TextStyle$1, overrides?: Partial<TextStyle$1>): TextStyle$1; | ||
| apply(style: TextStyle$1, options?: { | ||
| fontSizeFactor?: number; | ||
| fontSizeDelta?: number; | ||
| letterSpacingFactor?: number; | ||
| letterSpacingDelta?: number; | ||
| wordSpacingFactor?: number; | ||
| wordSpacingDelta?: number; | ||
| heightFactor?: number; | ||
| heightDelta?: number; | ||
| decoration?: TextDecoration$1; | ||
| }): TextStyle$1; | ||
| merge(base: TextStyle$1, override?: TextStyle$1): TextStyle$1; | ||
| resolveFontFamily(style: TextStyle$1): PdfStandardFont; | ||
| }; | ||
| interface ColorScheme { | ||
| readonly primary: string; | ||
| readonly secondary: string; | ||
| readonly background: string; | ||
| readonly surface: string; | ||
| readonly onBackground: string; | ||
| readonly onSurface: string; | ||
| readonly onPrimary: string; | ||
| readonly onSecondary: string; | ||
| readonly error: string; | ||
| readonly onError: string; | ||
| readonly success: string; | ||
| readonly warning: string; | ||
| readonly info: string; | ||
| } | ||
| interface SpacingSystem { | ||
| readonly xs: number; | ||
| readonly sm: number; | ||
| readonly md: number; | ||
| readonly lg: number; | ||
| readonly xl: number; | ||
| readonly xxl: number; | ||
| } | ||
| interface TypographyScale { | ||
| readonly display: TextStyle$1; | ||
| readonly headingLarge: TextStyle$1; | ||
| readonly headingMedium: TextStyle$1; | ||
| readonly headingSmall: TextStyle$1; | ||
| readonly title: TextStyle$1; | ||
| readonly bodyLarge: TextStyle$1; | ||
| readonly bodyMedium: TextStyle$1; | ||
| readonly bodySmall: TextStyle$1; | ||
| readonly label: TextStyle$1; | ||
| readonly caption: TextStyle$1; | ||
| } | ||
| interface ThemeData$1 { | ||
| readonly colorScheme: ColorScheme; | ||
| readonly spacing: SpacingSystem; | ||
| readonly typography: TypographyScale; | ||
| readonly defaultTextStyle: TextStyle$1; | ||
| readonly shape: { | ||
| readonly cornerRadius: { | ||
| readonly none: number; | ||
| readonly small: number; | ||
| readonly medium: number; | ||
| readonly large: number; | ||
| readonly extraLarge: number; | ||
| }; | ||
| }; | ||
| } | ||
| declare const ColorSchemes: { | ||
| light: ColorScheme; | ||
| dark: ColorScheme; | ||
| professional: ColorScheme; | ||
| }; | ||
| declare const defaultSpacing: SpacingSystem; | ||
| declare const ThemeUtils: { | ||
| createTheme(colorScheme?: ColorScheme, spacing?: SpacingSystem, baseFont?: PdfStandardFont, baseFontSize?: number): ThemeData$1; | ||
| light(baseFont?: PdfStandardFont, baseFontSize?: number): ThemeData$1; | ||
| dark(baseFont?: PdfStandardFont, baseFontSize?: number): ThemeData$1; | ||
| professional(baseFont?: PdfStandardFont, baseFontSize?: number): ThemeData$1; | ||
| copyWith(theme: ThemeData$1, overrides?: { | ||
| colorScheme?: Partial<ColorScheme>; | ||
| spacing?: Partial<SpacingSystem>; | ||
| typography?: Partial<TypographyScale>; | ||
| defaultTextStyle?: Partial<TextStyle$1>; | ||
| }): ThemeData$1; | ||
| }; | ||
| interface BoxConstraints { | ||
@@ -369,16 +507,4 @@ readonly minWidth: number; | ||
| } | ||
| interface ThemeData { | ||
| readonly textStyle: { | ||
| fontSize: number; | ||
| fontWeight: 'normal' | 'bold'; | ||
| color: string; | ||
| }; | ||
| readonly colors: { | ||
| primary: string; | ||
| secondary: string; | ||
| background: string; | ||
| surface: string; | ||
| text: string; | ||
| }; | ||
| } | ||
| type ThemeData = ThemeData$1; | ||
| declare const defaultTheme: ThemeData; | ||
@@ -770,3 +896,3 @@ interface LayoutContext { | ||
| } | ||
| interface TextDecoration { | ||
| interface LegacyTextDecoration { | ||
| underline?: boolean; | ||
@@ -777,3 +903,4 @@ strikethrough?: boolean; | ||
| } | ||
| interface TextStyle { | ||
| type TextDecoration = TextDecoration$1; | ||
| interface LegacyTextStyle { | ||
| fontSize?: number; | ||
@@ -787,7 +914,8 @@ fontFamily?: PdfStandardFont; | ||
| lineHeight?: number; | ||
| decoration?: TextDecoration; | ||
| decoration?: TextDecoration | LegacyTextDecoration; | ||
| } | ||
| type TextStyle = TextStyle$1; | ||
| interface TextProps extends WidgetProps { | ||
| content: string; | ||
| style?: TextStyle; | ||
| style?: TextStyle$1 | LegacyTextStyle; | ||
| textAlign?: TextAlign; | ||
@@ -806,2 +934,3 @@ overflow?: TextOverflow; | ||
| constructor(content: string, props?: Omit<TextProps, 'content'>); | ||
| private normalizeTextStyle; | ||
| private getPdfFont; | ||
@@ -817,3 +946,3 @@ private parseColor; | ||
| fontSize: number; | ||
| fontWeight: "bold"; | ||
| fontWeight: FontWeight$1.Bold; | ||
| fontFamily: PdfStandardFont.Helvetica; | ||
@@ -823,3 +952,3 @@ }; | ||
| fontSize: number; | ||
| fontWeight: "bold"; | ||
| fontWeight: FontWeight$1.Bold; | ||
| fontFamily: PdfStandardFont.Helvetica; | ||
@@ -829,3 +958,3 @@ }; | ||
| fontSize: number; | ||
| fontWeight: "bold"; | ||
| fontWeight: FontWeight$1.Bold; | ||
| fontFamily: PdfStandardFont.Helvetica; | ||
@@ -835,3 +964,3 @@ }; | ||
| fontSize: number; | ||
| fontWeight: "normal"; | ||
| fontWeight: FontWeight$1.Normal; | ||
| fontFamily: PdfStandardFont.Helvetica; | ||
@@ -841,3 +970,3 @@ }; | ||
| fontSize: number; | ||
| fontWeight: "normal"; | ||
| fontWeight: FontWeight$1.Normal; | ||
| fontFamily: PdfStandardFont.Helvetica; | ||
@@ -848,3 +977,3 @@ color: string; | ||
| fontSize: number; | ||
| fontWeight: "normal"; | ||
| fontWeight: FontWeight$1.Normal; | ||
| fontFamily: PdfStandardFont.Courier; | ||
@@ -857,3 +986,3 @@ color: string; | ||
| text: string; | ||
| style?: TextStyle; | ||
| style?: TextStyle$1; | ||
| children?: TextSpan[]; | ||
@@ -863,3 +992,3 @@ } | ||
| text: TextSpan; | ||
| style?: TextStyle; | ||
| style?: TextStyle$1; | ||
| textAlign?: TextAlign; | ||
@@ -887,8 +1016,8 @@ overflow?: TextOverflow; | ||
| declare const TextSpans: { | ||
| text: (text: string, style?: TextStyle) => TextSpan; | ||
| bold: (text: string, style?: TextStyle) => TextSpan; | ||
| italic: (text: string, style?: TextStyle) => TextSpan; | ||
| underline: (text: string, style?: TextStyle) => TextSpan; | ||
| colored: (text: string, color: string, style?: TextStyle) => TextSpan; | ||
| sized: (text: string, fontSize: number, style?: TextStyle) => TextSpan; | ||
| text: (text: string, style?: TextStyle$1) => TextSpan; | ||
| bold: (text: string, style?: TextStyle$1) => TextSpan; | ||
| italic: (text: string, style?: TextStyle$1) => TextSpan; | ||
| underline: (text: string, style?: TextStyle$1) => TextSpan; | ||
| colored: (text: string, color: string, style?: TextStyle$1) => TextSpan; | ||
| sized: (text: string, fontSize: number, style?: TextStyle$1) => TextSpan; | ||
| combine: (...spans: TextSpan[]) => TextSpan; | ||
@@ -1249,2 +1378,77 @@ }; | ||
| interface ThemeContext { | ||
| readonly theme: ThemeData$1; | ||
| readonly textStyle: TextStyle$1; | ||
| readonly depth: number; | ||
| } | ||
| interface ThemeProps extends WidgetProps { | ||
| data: ThemeData$1; | ||
| child: Widget; | ||
| } | ||
| declare class Theme extends BaseWidget { | ||
| private readonly themeData; | ||
| private readonly child; | ||
| constructor(props: ThemeProps); | ||
| layout(context: LayoutContext): LayoutResult; | ||
| paint(context: PaintContext): void; | ||
| static of(context: LayoutContext | PaintContext): ThemeData$1; | ||
| } | ||
| interface DefaultTextStyleProps extends WidgetProps { | ||
| style: TextStyle$1; | ||
| child: Widget; | ||
| merge?: boolean; | ||
| } | ||
| declare class DefaultTextStyle extends BaseWidget { | ||
| private readonly style; | ||
| private readonly child; | ||
| private readonly merge; | ||
| constructor(props: DefaultTextStyleProps); | ||
| layout(context: LayoutContext): LayoutResult; | ||
| paint(context: PaintContext): void; | ||
| static merge(props: Omit<DefaultTextStyleProps, 'merge'>): DefaultTextStyle; | ||
| static replace(props: Omit<DefaultTextStyleProps, 'merge'>): DefaultTextStyle; | ||
| } | ||
| interface ThemedWidgetProps extends WidgetProps { | ||
| builder: (theme: ThemeData$1) => Widget; | ||
| } | ||
| declare class ThemedWidget extends BaseWidget { | ||
| private readonly builder; | ||
| private cachedWidget?; | ||
| private cachedTheme?; | ||
| constructor(props: ThemedWidgetProps); | ||
| private getWidget; | ||
| layout(context: LayoutContext): LayoutResult; | ||
| paint(context: PaintContext): void; | ||
| } | ||
| interface ThemeConsumerProps<T> extends WidgetProps { | ||
| selector: (theme: ThemeData$1) => T; | ||
| builder: (data: T) => Widget; | ||
| } | ||
| declare class ThemeConsumer<T> extends BaseWidget { | ||
| private readonly selector; | ||
| private readonly builder; | ||
| private cachedWidget?; | ||
| private cachedData?; | ||
| constructor(props: ThemeConsumerProps<T>); | ||
| private getWidget; | ||
| layout(context: LayoutContext): LayoutResult; | ||
| paint(context: PaintContext): void; | ||
| } | ||
| declare const ThemeHelpers: { | ||
| withColorScheme(builder: (colors: ColorScheme) => Widget): ThemeConsumer<ColorScheme>; | ||
| withSpacing(builder: (spacing: SpacingSystem) => Widget): ThemeConsumer<SpacingSystem>; | ||
| withTypography(builder: (typography: TypographyScale) => Widget): ThemeConsumer<TypographyScale>; | ||
| withTextStyle(styleKey: keyof TypographyScale, builder: (style: TextStyle$1) => Widget): ThemeConsumer<TextStyle$1>; | ||
| withThemeData<T>(selector: (theme: ThemeData$1) => T, builder: (data: T) => Widget): ThemeConsumer<T>; | ||
| wrap(theme: ThemeData$1, child: Widget): Theme; | ||
| light(child: Widget): Theme; | ||
| dark(child: Widget): Theme; | ||
| professional(child: Widget): Theme; | ||
| withTextStyleOverride(style: TextStyle$1, child: Widget): DefaultTextStyle; | ||
| withTextStyleReplacement(style: TextStyle$1, child: Widget): DefaultTextStyle; | ||
| }; | ||
| declare const createTheme: (data: ThemeData$1, child: Widget) => Theme; | ||
| declare const createThemedWidget: (builder: (theme: ThemeData$1) => Widget) => ThemedWidget; | ||
| declare const createDefaultTextStyle: (style: TextStyle$1, child: Widget) => DefaultTextStyle; | ||
| type WidgetBuilder = () => Widget; | ||
@@ -1285,3 +1489,3 @@ declare class SingleWidgetLayout { | ||
| margins: EdgeInsets; | ||
| theme: ThemeData; | ||
| theme: ThemeData$1; | ||
| }; | ||
@@ -1294,3 +1498,3 @@ | ||
| export { Align, AlignHelpers, Alignment, AlignmentUtils, Axis, BaseWidget, BorderRadiusUtils, BorderStyle, BoxConstraints, Center, CenterHelpers, Column, Container, ContainerDecorations, CrossAxisAlignment, DEV, Document, EdgeInsets, EmptyWidget, Expanded, Flex, FlexFit, FlexUtils, FlexWidgets, Flexible, FontCategory, FontFallbackSystem, FontRegistry, FontStyle, FontUtils, FontWeight, LayoutHelpers, MainAxisAlignment, MainAxisSize, Margin, MarginHelpers, Matrix4, Padding, PaddingHelpers, Page, PageDefaults, PdfArray, PdfCatalog, PdfColorRgb, PdfContentStream, PdfDict, PdfDocument, PdfFont, PdfGraphics, PdfIndirect, PdfInfo, PdfLineCap, PdfLineJoin, PdfName, PdfNum, PdfNumList, PdfObject, PdfPage, PdfPageList, PdfStandardFont, PdfStream, PdfString, PdfTextRenderingMode, Positioned, PositionedHelpers, RichText, Row, SingleWidgetLayout, Stack, StackFit, StackHelpers, Text, TextAlign, TextDirection, TextMeasurementUtils, TextMetricsEngine, TextOverflow, TextSpans, TextStyles, VERSION, WidgetComposition, WidgetHelpers, WidgetUtils, createAlign, createCenter, createContainer, createMargin, createPadding, createPositioned, createRichText, createStack, createText, defaultFontFallback, defaultTextMetrics, defaultTheme, utils }; | ||
| export type { AlignProps, AlignmentGeometry, Border, BorderRadius, BoxDecoration, BoxShadow, CenterProps, CharacterMetrics, ContainerProps, DocumentInfo, EnhancedFontMetrics, FlexChild, FlexChildData, FlexLayoutData, FlexProps, FlexSpacing, FontDescriptor, LayoutContext, LayoutResult, LineBreakingOptions, LineMetrics, MarginProps, Matrix, PaddingProps, PageOptions, PaintContext, ParagraphMetrics, PdfColor, PdfDataType, PdfDocumentSettings, PdfOptions, PdfOutputContext, Point, PositionedProps, Rect, RichTextProps, Size, StackProps, TextDecoration, TextMeasurementOptions, TextProps, TextSpan, TextStyle, ThemeData, Widget, WidgetBuilder, WidgetProps, WordMetrics }; | ||
| export { Align, AlignHelpers, Alignment, AlignmentUtils, Axis, BaseWidget, BorderRadiusUtils, BorderStyle, BoxConstraints, Center, CenterHelpers, ColorSchemes, Column, Container, ContainerDecorations, CrossAxisAlignment, DEV, DefaultTextStyle, Document, EdgeInsets, EmptyWidget, Expanded, Flex, FlexFit, FlexUtils, FlexWidgets, Flexible, FontCategory, FontFallbackSystem, FontRegistry, FontStyle, FontUtils, FontWeight, LayoutHelpers, MainAxisAlignment, MainAxisSize, Margin, MarginHelpers, Matrix4, Padding, PaddingHelpers, Page, PageDefaults, PdfArray, PdfCatalog, PdfColorRgb, PdfContentStream, PdfDict, PdfDocument, PdfFont, PdfGraphics, PdfIndirect, PdfInfo, PdfLineCap, PdfLineJoin, PdfName, PdfNum, PdfNumList, PdfObject, PdfPage, PdfPageList, PdfStandardFont, PdfStream, PdfString, PdfTextRenderingMode, Positioned, PositionedHelpers, RichText, Row, SingleWidgetLayout, Stack, StackFit, StackHelpers, Text, TextAlign, TextDecorationFlag, TextDecorationStyle, TextDirection, TextMeasurementUtils, TextMetricsEngine, TextOverflow, TextSpans, TextStyleUtils, TextStyles, Theme, ThemeConsumer, ThemeHelpers, ThemeUtils, ThemedWidget, VERSION, WidgetComposition, WidgetHelpers, WidgetUtils, createAlign, createCenter, createContainer, createDefaultTextStyle, createMargin, createPadding, createPositioned, createRichText, createStack, createText, createTheme, createThemedWidget, defaultFontFallback, defaultSpacing, defaultTextMetrics, defaultTheme, utils }; | ||
| export type { AlignProps, AlignmentGeometry, Border, BorderRadius, BoxDecoration, BoxShadow, CenterProps, CharacterMetrics, ColorScheme, ContainerProps, DefaultTextStyleProps, DocumentInfo, EnhancedFontMetrics, FlexChild, FlexChildData, FlexLayoutData, FlexProps, FlexSpacing, FontDescriptor, LayoutContext, LayoutResult, LineBreakingOptions, LineMetrics, MarginProps, Matrix, PaddingProps, PageOptions, PaintContext, ParagraphMetrics, PdfColor, PdfDataType, PdfDocumentSettings, PdfOptions, PdfOutputContext, Point, PositionedProps, Rect, RichTextProps, Size, SpacingSystem, StackProps, TextDecoration, TextMeasurementOptions, TextProps, TextSpan, TextStyle, ThemeConsumerProps, ThemeContext, ThemeData, ThemeProps, ThemedWidgetProps, TypographyScale, Widget, WidgetBuilder, WidgetProps, WordMetrics }; |
+2
-2
| { | ||
| "name": "typescript-pdf", | ||
| "version": "0.2.0", | ||
| "version": "0.3.0", | ||
| "description": "A modern TypeScript library for programmatic PDF generation with a declarative API", | ||
@@ -121,2 +121,2 @@ "keywords": [ | ||
| ] | ||
| } | ||
| } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
872190
13.06%10905
13.44%62
14.81%