import { ReadableBitStream, ReadableByteStream } from "@open-flash/stream"; import { Uint2, UintSize } from "semantic-types"; import { CapStyle } from "swf-types/cap-style"; import { FillStyle } from "swf-types/fill-style"; import * as fillStyles from "swf-types/fill-styles/index"; import { Glyph } from "swf-types/glyph"; import { LineStyle } from "swf-types/line-style"; import { ShapeRecord } from "swf-types/shape-record"; import * as shapeRecords from "swf-types/shape-records/index"; import { Shape } from "swf-types/shape"; export declare enum ShapeVersion { Shape1 = 1, Shape2 = 2, Shape3 = 3, Shape4 = 4 } export declare function parseGlyph(byteStream: ReadableByteStream): Glyph; export declare function parseGlyphBits(bitStream: ReadableBitStream): Glyph; export declare function parseShape(byteStream: ReadableByteStream, shapeVersion: ShapeVersion): Shape; export declare function parseShapeBits(bitStream: ReadableBitStream, shapeVersion: ShapeVersion): Shape; export interface ParserShapeStyles { fill: FillStyle[]; line: LineStyle[]; fillBits: UintSize; lineBits: UintSize; } export declare function parseShapeStylesBits(bitStream: ReadableBitStream, shapeVersion: ShapeVersion): ParserShapeStyles; export declare function parseShapeRecordStringBits(bitStream: ReadableBitStream, fillBits: UintSize, lineBits: UintSize, shapeVersion: ShapeVersion): ShapeRecord[]; export declare function parseCurvedEdgeBits(bitStream: ReadableBitStream): shapeRecords.Edge; export declare function parseStraightEdgeBits(bitStream: ReadableBitStream): shapeRecords.Edge; export declare function parseStyleChangeBits(bitStream: ReadableBitStream, fillBits: UintSize, lineBits: UintSize, shapeVersion: ShapeVersion): [shapeRecords.StyleChange, [UintSize, UintSize]]; /** * Parse a fill style list length or line style list length. * * @param byteStream Stream to use to parse this list length. Will mutate its state. * @param allowExtended Allow extended size (`> 255`). Here are the recommended values: * - `true` for `DefineShape2`, `DefineShape3`, `DefineShape4` * - `false` for `DefineShape` * @returns List length */ export declare function parseListLength(byteStream: ReadableByteStream, allowExtended: boolean): UintSize; export declare function parseFillStyleList(byteStream: ReadableByteStream, shapeVersion: ShapeVersion): FillStyle[]; export declare function parseFillStyle(byteStream: ReadableByteStream, withAlpha: boolean): FillStyle; export declare function parseBitmapFill(byteStream: ReadableByteStream, repeating: boolean, smoothed: boolean): fillStyles.Bitmap; export declare function parseFocalGradientFill(byteStream: ReadableByteStream, withAlpha: boolean): fillStyles.FocalGradient; export declare function parseLinearGradientFill(byteStream: ReadableByteStream, withAlpha: boolean): fillStyles.LinearGradient; export declare function parseRadialGradientFill(byteStream: ReadableByteStream, withAlpha: boolean): fillStyles.RadialGradient; export declare function parseSolidFill(byteStream: ReadableByteStream, withAlpha: boolean): fillStyles.Solid; export declare function parseLineStyleList(byteStream: ReadableByteStream, shapeVersion: ShapeVersion): LineStyle[]; export declare function parseLineStyle(byteStream: ReadableByteStream, withAlpha: boolean): LineStyle; export declare function parseLineStyle2(byteStream: ReadableByteStream): LineStyle; export declare function capStyleFromId(capStyleId: Uint2): CapStyle;