Skip to content

Commit

Permalink
ptt - remove unused types
Browse files Browse the repository at this point in the history
  • Loading branch information
Jodi Giordano committed Oct 23, 2024
1 parent e7a0e9b commit 5f6de4c
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions app/src/pixi-tagged-text/types.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
Text,
Texture,
BaseTexture,
BitmapText,
Sprite,
IBitmapTextStyle,
ITextStyle,
Expand All @@ -26,23 +22,8 @@ export type Bounds = Rectangle;

export type Nested<T> = T | Array<Nested<T>>;

export type PixiTextTypes = Text | BitmapText;

///// OPTIONS

export type SpriteSource =
| string
| Texture
| HTMLCanvasElement
| HTMLVideoElement;

export type TextureSource =
| string
| HTMLImageElement
| HTMLCanvasElement
| HTMLVideoElement
| BaseTexture;

export type FontProperty = string | number;
export type FontMap = Record<string, FontProperty>;

Expand All @@ -56,7 +37,6 @@ export interface TaggedTextOptions {
debug?: boolean;
adjustFontBaseline?: FontMap;
imgMap?: Record<string, Sprite>;
scaleIcons?: boolean;
skipUpdates?: boolean;
skipDraw?: boolean;
drawWhitespace?: boolean;
Expand Down Expand Up @@ -111,7 +91,6 @@ export type ImageDisplayMode = "icon" | "block" | "inline";
export type ImageReference = string;
export type ImageDimensionPercentage = string;
export type ImageDimension = number | string | ImageDimensionPercentage;
export type TextTransform = "normal" | "capitalize" | "uppercase" | "lowercase";
export type FontStyle = "normal" | "italic" | "oblique";
export type TextDecorationValue = "underline" | "overline" | "line-through";
export type TextDecoration =
Expand Down Expand Up @@ -167,9 +146,6 @@ export interface FontScaleStyles {
fontScaleWidth?: number;
fontScaleHeight?: number;
}
export interface TextTransformStyles {
textTransform?: TextTransform;
}

export interface LineBreakStyles {
breakLines?: boolean;
Expand All @@ -184,7 +160,6 @@ export interface TextStyleExtended
VerticalAlignStyles,
VerticalSpacingStyles,
FontScaleStyles,
TextTransformStyles,
LineBreakStyles {
// Overridden properties
align?: Align;
Expand Down Expand Up @@ -332,19 +307,6 @@ export const isNewlineToken = (t?: Nested<SegmentToken>): boolean =>
export const isEmptyObject = <T>(a: T): boolean =>
a instanceof Object && Object.keys(a).length === 0;

export const isPixel = (s: string): boolean => s.trim().endsWith("px");

export const isEm = (s: string): boolean => s.trim().endsWith("em");

export const isPercent = (s: string): boolean => s.trim().endsWith("%");

export const pixelToNumber = (s: string): number =>
Number(s.trim().slice(0, -2));
export const emToNumber = pixelToNumber;

export const percentStringToNumber = (s: string): number =>
isPercent(s) ? Number(s.trim().slice(0, -1)) / 100 : NaN;

export const measurementValueToComponents = (
input: MeasurementValue,
): MeasurementComponents => {
Expand Down

0 comments on commit 5f6de4c

Please sign in to comment.