import { Keyword , Token } from "@siteimprove/alfa-css" ; import { Err , Result } from "@siteimprove/alfa-result" ; import { Property } from "../property" ; import * as Color from "./outline-color" ; import * as Style from "./outline-style" ; import * as Width from "./outline-width" ; declare module "../property" { interface Shorthands { outline : Property . Shorthand < "outline-width" | "outline-style" | "outline-color" > ; } } /**
 *  https internal export default Property . registerShorthand ( "outline" , Property . shorthand ( [ "outline-width" , "outline-style" , "outline-color" ] , ( input ) => { let width ; let style ; let color ; while ( true ) { for ( const [ remainder ] of Token . parseWhitespace ( input ) ) { input = remainder ; } if ( width === undefined ) { const result = Width . parse ( input ) ; if ( result . isOk ( ) ) { [ input , width ] = result . get ( ) ; continue ; } } if ( style === undefined ) { const result = Style . parse ( input ) ; if ( result . isOk ( ) ) { [ input , style ] = result . get ( ) ; continue ; } } if ( color === undefined ) { const result = Color . parse ( input ) ; if ( result . isOk ( ) ) { [ input , color ] = result . get ( ) ; continue ; } } break ; } if ( width === undefined && style === undefined && color === undefined ) { return Err . of ( `Expected one of width, style, or color` ) ; } return Result . of ( [ input , [ [ "outline-width" , width ?? Keyword . of ( "initial" ) ] , [ "outline-style" , style ?? Keyword . of ( "initial" ) ] , [ "outline-color" , color ?? Keyword . of ( "initial" ) ] , ] , ] ) ; } ) ) ;