import { Parser } from "@siteimprove/alfa-parser" ; import { Slice } from "@siteimprove/alfa-slice" ; import { Token } from "../syntax/token" ; import { Angle } from "./angle" ; import { Length } from "./length" ; import { Number } from "./number" ; import { Percentage } from "./percentage" ; import { Matrix } from "./transform/matrix" ; import { Perspective } from "./transform/perspective" ; import { Rotate } from "./transform/rotate" ; import { Scale } from "./transform/scale" ; import { Skew } from "./transform/skew" ; import { Translate } from "./transform/translate" ; const { either , oneOrMore , delimited , option } = Parser ; public export type Transform = Matrix | Perspective | Rotate | Scale | Skew | Translate ; public export namespace Transform { export function matrix ( ... values ) { return Matrix . of ( ... values ) ; } export function perspective < D extends Length > ( depth ) { return Perspective . of ( depth ) ; } export function rotate < A extends Angle > ( x , y , z , angle ) { return Rotate . of ( x , y , z , angle ) ; } export function scale ( x , y ) { return Scale . of ( x , y ) ; } export function skew < X extends Angle , Y extends Angle > ( x , y ) { return Skew . of ( x , y ) ; } export function translate < X extends Length | Percentage , Y extends Length | Percentage , Z extends Length > ( x , y , z ) { return Translate . of ( x , y , z ) ; } /**
     *  https export const parse = either < Slice < Token > , Transform , string > ( Matrix . parse , Perspective . parse , Rotate . parse , Scale . parse , Skew . parse , Translate . parse ) ; /**
     *  https export const parseList = oneOrMore ( delimited ( option ( Token . parseWhitespace ) , parse ) ) ; }