| 1 | package Template::Flute::Types; | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | Template::Flute::Types - Type::Tiny types for Template::Flute | ||
| 6 | |||
| 7 | =head1 DESCRIPTION | ||
| 8 | |||
| 9 | Extends L<Types::Standard> with extra L<Template::Flute> type constraints. | ||
| 10 | |||
| 11 | =cut | ||
| 12 | |||
| 13 | use strict; | ||
| 14 | use warnings; | ||
| 15 | |||
| 16 | use Type::Library -base; | ||
| 17 | use Type::Utils -all; | ||
| 18 | use Sub::Quote 'quote_sub'; | ||
| 19 | |||
| 20 | BEGIN { extends "Types::Standard" } | ||
| 21 | |||
| 22 | =head1 TYPES | ||
| 23 | |||
| 24 | =head2 HtmlParser | ||
| 25 | |||
| 26 | An instance of L<Template::Flute::HTML>. | ||
| 27 | |||
| 28 | =head2 Specification | ||
| 29 | |||
| 30 | An instance of L<Template::Flute::Specification>. | ||
| 31 | |||
| 32 | =head2 URI | ||
| 33 | |||
| 34 | An instance of L<URI>. | ||
| 35 | |||
| 36 | =cut | ||
| 37 | |||
| 38 | declare 'HtmlParser', | ||
| 39 | as InstanceOf ['Template::Flute::HTML']; | ||
| 40 | |||
| 41 | declare 'ReadableFilePath', | ||
| 42 | constraint => quote_sub q{ -e $_ && -r $_ }; | ||
| 43 | |||
| 44 | declare 'Specification', | ||
| 45 | as InstanceOf ['Template::Flute::Specification']; | ||
| 46 | |||
| 47 | declare 'URI', | ||
| 48 | as InstanceOf ['URI']; | ||
| 49 | |||
| 50 | 1; |