@johnmorrisdotca/dougu-sports 0.28.1 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/NOTICE.md +1 -0
- package/README.md +71 -5
- package/dist/brands/brand.ball.d.ts +25 -2
- package/dist/brands/brand.ball.js +16 -1
- package/dist/brands/brand.data.d.ts +108 -5
- package/dist/brands/brand.data.js +32 -0
- package/dist/brands/brand.letters.d.ts +39 -4
- package/dist/brands/brand.letters.js +20 -2
- package/dist/brands/brand.render.d.ts +73 -6
- package/dist/brands/brand.render.js +35 -2
- package/dist/element.d.ts +32 -0
- package/dist/element.js +177 -0
- package/dist/emblems/award/badge.d.ts +8 -1
- package/dist/emblems/award/badge.js +8 -1
- package/dist/emblems/award/crown.d.ts +8 -1
- package/dist/emblems/award/crown.js +8 -1
- package/dist/emblems/award/medal.d.ts +8 -1
- package/dist/emblems/award/medal.js +8 -1
- package/dist/emblems/award/ribbon.d.ts +8 -1
- package/dist/emblems/award/ribbon.js +8 -1
- package/dist/emblems/award/shield.d.ts +8 -1
- package/dist/emblems/award/shield.js +8 -1
- package/dist/emblems/award/star.d.ts +8 -1
- package/dist/emblems/award/star.js +8 -1
- package/dist/emblems/ball/ball.afl.d.ts +8 -0
- package/dist/emblems/ball/ball.afl.js +8 -0
- package/dist/emblems/ball/ball.baseball.vintage.d.ts +40 -5
- package/dist/emblems/ball/ball.baseball.vintage.js +40 -5
- package/dist/emblems/ball/ball.basketball.d.ts +8 -0
- package/dist/emblems/ball/ball.basketball.js +8 -0
- package/dist/emblems/ball/ball.basketball3x3.d.ts +8 -0
- package/dist/emblems/ball/ball.basketball3x3.js +8 -0
- package/dist/emblems/ball/ball.basketball6.d.ts +8 -0
- package/dist/emblems/ball/ball.basketball6.js +8 -0
- package/dist/emblems/ball/ball.core.d.ts +16 -1
- package/dist/emblems/ball/ball.cricket.d.ts +24 -0
- package/dist/emblems/ball/ball.cricket.js +24 -0
- package/dist/emblems/ball/ball.curlingstone.d.ts +8 -0
- package/dist/emblems/ball/ball.curlingstone.js +8 -0
- package/dist/emblems/ball/ball.discus.d.ts +8 -0
- package/dist/emblems/ball/ball.discus.js +8 -0
- package/dist/emblems/ball/ball.face.d.ts +48 -4
- package/dist/emblems/ball/ball.fieldhockey.d.ts +8 -0
- package/dist/emblems/ball/ball.fieldhockey.js +8 -0
- package/dist/emblems/ball/ball.football.d.ts +24 -0
- package/dist/emblems/ball/ball.football.js +24 -0
- package/dist/emblems/ball/ball.gaelic.d.ts +16 -0
- package/dist/emblems/ball/ball.gaelic.js +16 -0
- package/dist/emblems/ball/ball.golf.d.ts +8 -0
- package/dist/emblems/ball/ball.golf.js +8 -0
- package/dist/emblems/ball/ball.hammer.d.ts +8 -0
- package/dist/emblems/ball/ball.hammer.js +8 -0
- package/dist/emblems/ball/ball.handball.d.ts +8 -0
- package/dist/emblems/ball/ball.handball.js +8 -0
- package/dist/emblems/ball/ball.index.d.ts +15 -4
- package/dist/emblems/ball/ball.index.js +8 -6
- package/dist/emblems/ball/ball.padel.d.ts +8 -0
- package/dist/emblems/ball/ball.padel.js +8 -0
- package/dist/emblems/ball/ball.pickleball.d.ts +16 -0
- package/dist/emblems/ball/ball.pickleball.js +16 -0
- package/dist/emblems/ball/ball.plastic.d.ts +38 -1
- package/dist/emblems/ball/ball.plastic.js +73 -0
- package/dist/emblems/ball/ball.print.d.ts +71 -7
- package/dist/emblems/ball/ball.print.js +8 -0
- package/dist/emblems/ball/ball.printable.d.ts +48 -0
- package/dist/emblems/ball/ball.printable.js +48 -0
- package/dist/emblems/ball/ball.puck.d.ts +8 -0
- package/dist/emblems/ball/ball.puck.js +8 -0
- package/dist/emblems/ball/ball.puck.print.d.ts +64 -0
- package/dist/emblems/ball/ball.puck.print.js +64 -0
- package/dist/emblems/ball/ball.roundnet.d.ts +8 -0
- package/dist/emblems/ball/ball.roundnet.js +8 -0
- package/dist/emblems/ball/ball.rugby.d.ts +8 -0
- package/dist/emblems/ball/ball.rugby.js +8 -0
- package/dist/emblems/ball/ball.sepaktakraw.d.ts +8 -0
- package/dist/emblems/ball/ball.sepaktakraw.js +8 -0
- package/dist/emblems/ball/ball.shuttlecock.d.ts +16 -0
- package/dist/emblems/ball/ball.shuttlecock.js +16 -0
- package/dist/emblems/ball/ball.sliotar.d.ts +8 -0
- package/dist/emblems/ball/ball.sliotar.js +8 -0
- package/dist/emblems/ball/ball.smooth.d.ts +32 -0
- package/dist/emblems/ball/ball.smooth.js +32 -0
- package/dist/emblems/ball/ball.soccer.era.d.ts +96 -12
- package/dist/emblems/ball/ball.soccer.era.js +96 -12
- package/dist/emblems/ball/ball.soccer.indoor.d.ts +16 -0
- package/dist/emblems/ball/ball.soccer.indoor.js +16 -0
- package/dist/emblems/ball/ball.soccer.panels.d.ts +120 -0
- package/dist/emblems/ball/ball.soccer.panels.js +120 -0
- package/dist/emblems/ball/ball.soccer.store.d.ts +144 -0
- package/dist/emblems/ball/ball.soccer.store.js +144 -0
- package/dist/emblems/ball/ball.soccer.vintage.d.ts +40 -5
- package/dist/emblems/ball/ball.soccer.vintage.js +40 -5
- package/dist/emblems/ball/ball.squash.d.ts +40 -0
- package/dist/emblems/ball/ball.squash.js +40 -0
- package/dist/emblems/ball/ball.tennis.d.ts +8 -0
- package/dist/emblems/ball/ball.tennis.js +8 -0
- package/dist/emblems/ball/ball.teqball.d.ts +8 -0
- package/dist/emblems/ball/ball.teqball.js +8 -0
- package/dist/emblems/ball/ball.volleyball.d.ts +24 -0
- package/dist/emblems/ball/ball.volleyball.flag.d.ts +88 -0
- package/dist/emblems/ball/ball.volleyball.flag.js +88 -0
- package/dist/emblems/ball/ball.volleyball.js +24 -0
- package/dist/emblems/ball/ball.waterpolo.d.ts +8 -0
- package/dist/emblems/ball/ball.waterpolo.js +8 -0
- package/dist/emblems/crest/diamond.d.ts +8 -1
- package/dist/emblems/crest/diamond.js +8 -1
- package/dist/emblems/crest/pennant.d.ts +8 -1
- package/dist/emblems/crest/pennant.js +8 -1
- package/dist/emblems/crest/roundel.d.ts +8 -1
- package/dist/emblems/crest/roundel.js +8 -1
- package/dist/emblems/crest/shield.d.ts +8 -1
- package/dist/emblems/crest/shield.js +8 -1
- package/dist/emblems/emblem.api.d.ts +178 -17
- package/dist/emblems/emblem.api.js +138 -13
- package/dist/emblems/emblem.core.d.ts +104 -8
- package/dist/emblems/emblem.core.js +32 -2
- package/dist/emblems/emblem.descriptions.d.ts +17 -1
- package/dist/emblems/emblem.descriptions.js +11 -0
- package/dist/emblems/emblem.display.d.ts +53 -5
- package/dist/emblems/emblem.display.js +6 -0
- package/dist/emblems/emblem.embed.d.ts +68 -0
- package/dist/emblems/emblem.embed.js +65 -0
- package/dist/emblems/emblem.equipment.d.ts +12 -1
- package/dist/emblems/emblem.equipment.js +2 -0
- package/dist/emblems/emblem.ids.d.ts +273 -18
- package/dist/emblems/emblem.ids.js +137 -15
- package/dist/emblems/emblem.lathe.d.ts +70 -6
- package/dist/emblems/emblem.named.d.ts +37 -4
- package/dist/emblems/emblem.named.js +18 -2
- package/dist/emblems/emblem.registry.d.ts +8 -1
- package/dist/emblems/emblem.registry.js +8 -1
- package/dist/emblems/emblem.shapes.d.ts +25 -2
- package/dist/emblems/emblem.sprite.d.ts +33 -3
- package/dist/emblems/emblem.sprite.js +3 -0
- package/dist/emblems/emblem.uri.d.ts +13 -1
- package/dist/emblems/emblem.uri.js +3 -0
- package/dist/emblems/gear/gear.badmintonracket.d.ts +8 -0
- package/dist/emblems/gear/gear.badmintonracket.js +8 -0
- package/dist/emblems/gear/gear.baseballcap.d.ts +8 -0
- package/dist/emblems/gear/gear.baseballcap.js +8 -0
- package/dist/emblems/gear/gear.baseballglove.d.ts +8 -0
- package/dist/emblems/gear/gear.baseballglove.js +8 -0
- package/dist/emblems/gear/gear.budo.d.ts +224 -4
- package/dist/emblems/gear/gear.budo.js +205 -3
- package/dist/emblems/gear/gear.budo.steps.d.ts +68 -1
- package/dist/emblems/gear/gear.budo.steps.js +59 -1
- package/dist/emblems/gear/gear.cricketbat.d.ts +8 -0
- package/dist/emblems/gear/gear.cricketbat.js +8 -0
- package/dist/emblems/gear/gear.field.d.ts +48 -0
- package/dist/emblems/gear/gear.field.js +48 -0
- package/dist/emblems/gear/gear.fieldhockeystick.d.ts +8 -0
- package/dist/emblems/gear/gear.fieldhockeystick.js +8 -0
- package/dist/emblems/gear/gear.footballhelmet.d.ts +8 -0
- package/dist/emblems/gear/gear.footballhelmet.js +8 -0
- package/dist/emblems/gear/gear.goaliemask.d.ts +8 -0
- package/dist/emblems/gear/gear.goaliemask.js +8 -0
- package/dist/emblems/gear/gear.goalnet.d.ts +8 -0
- package/dist/emblems/gear/gear.goalnet.js +8 -0
- package/dist/emblems/gear/gear.hockeystick.d.ts +8 -0
- package/dist/emblems/gear/gear.hockeystick.js +8 -0
- package/dist/emblems/gear/gear.kendo.d.ts +16 -0
- package/dist/emblems/gear/gear.kendo.js +16 -0
- package/dist/emblems/gear/gear.kyudo.d.ts +16 -0
- package/dist/emblems/gear/gear.kyudo.js +16 -0
- package/dist/emblems/gear/gear.lacrossestick.d.ts +8 -0
- package/dist/emblems/gear/gear.lacrossestick.js +8 -0
- package/dist/emblems/gear/gear.nets.d.ts +24 -0
- package/dist/emblems/gear/gear.nets.js +24 -0
- package/dist/emblems/gear/gear.rackets.d.ts +32 -0
- package/dist/emblems/gear/gear.rackets.js +32 -0
- package/dist/emblems/gear/gear.skates.d.ts +24 -0
- package/dist/emblems/gear/gear.skates.js +24 -0
- package/dist/emblems/gear/gear.sticks.d.ts +24 -0
- package/dist/emblems/gear/gear.sticks.js +24 -0
- package/dist/emblems/gear/gear.sumo.d.ts +16 -0
- package/dist/emblems/gear/gear.sumo.js +16 -0
- package/dist/emblems/gear/gear.tabletennispaddle.d.ts +8 -0
- package/dist/emblems/gear/gear.tabletennispaddle.js +8 -0
- package/dist/emblems/gear/gear.tennisracket.d.ts +8 -0
- package/dist/emblems/gear/gear.tennisracket.js +8 -0
- package/dist/emblems/gear/gear.track.d.ts +32 -0
- package/dist/emblems/gear/gear.track.js +32 -0
- package/dist/emblems/gear/gear.water.d.ts +16 -0
- package/dist/emblems/gear/gear.water.js +16 -0
- package/dist/emblems/medal/bronze.d.ts +8 -1
- package/dist/emblems/medal/bronze.js +8 -1
- package/dist/emblems/medal/gold.d.ts +8 -1
- package/dist/emblems/medal/gold.js +8 -1
- package/dist/emblems/medal/place-1.d.ts +8 -1
- package/dist/emblems/medal/place-1.js +8 -1
- package/dist/emblems/medal/place-2.d.ts +8 -1
- package/dist/emblems/medal/place-2.js +8 -1
- package/dist/emblems/medal/place-3.d.ts +8 -1
- package/dist/emblems/medal/place-3.js +8 -1
- package/dist/emblems/medal/silver.d.ts +8 -1
- package/dist/emblems/medal/silver.js +8 -1
- package/dist/emblems/pennant/championship.d.ts +8 -1
- package/dist/emblems/pennant/championship.js +8 -1
- package/dist/emblems/sport/afl.d.ts +8 -1
- package/dist/emblems/sport/afl.js +8 -1
- package/dist/emblems/sport/artisticswimming.d.ts +8 -1
- package/dist/emblems/sport/artisticswimming.js +8 -1
- package/dist/emblems/sport/athletics.d.ts +8 -1
- package/dist/emblems/sport/athletics.js +8 -1
- package/dist/emblems/sport/badminton.d.ts +8 -1
- package/dist/emblems/sport/badminton.js +8 -1
- package/dist/emblems/sport/boxing.d.ts +8 -1
- package/dist/emblems/sport/boxing.js +8 -1
- package/dist/emblems/sport/cfl.d.ts +8 -1
- package/dist/emblems/sport/cfl.js +8 -1
- package/dist/emblems/sport/cricket.d.ts +8 -1
- package/dist/emblems/sport/cricket.js +8 -1
- package/dist/emblems/sport/curling.d.ts +8 -1
- package/dist/emblems/sport/curling.js +8 -1
- package/dist/emblems/sport/diving.d.ts +8 -1
- package/dist/emblems/sport/diving.js +8 -1
- package/dist/emblems/sport/fieldhockey.d.ts +8 -1
- package/dist/emblems/sport/fieldhockey.js +8 -1
- package/dist/emblems/sport/gaelic.d.ts +8 -1
- package/dist/emblems/sport/gaelic.js +8 -1
- package/dist/emblems/sport/handball.d.ts +8 -1
- package/dist/emblems/sport/handball.js +8 -1
- package/dist/emblems/sport/ifaf.d.ts +8 -1
- package/dist/emblems/sport/ifaf.js +8 -1
- package/dist/emblems/sport/judo.d.ts +8 -1
- package/dist/emblems/sport/judo.js +8 -1
- package/dist/emblems/sport/karate.d.ts +8 -1
- package/dist/emblems/sport/karate.js +8 -1
- package/dist/emblems/sport/kendo.d.ts +8 -1
- package/dist/emblems/sport/kendo.js +8 -1
- package/dist/emblems/sport/kyudo.d.ts +8 -1
- package/dist/emblems/sport/kyudo.js +8 -1
- package/dist/emblems/sport/lacrosse.d.ts +8 -1
- package/dist/emblems/sport/lacrosse.js +8 -1
- package/dist/emblems/sport/mlb.d.ts +8 -1
- package/dist/emblems/sport/mlb.js +8 -1
- package/dist/emblems/sport/mma.d.ts +8 -1
- package/dist/emblems/sport/mma.js +8 -1
- package/dist/emblems/sport/nba.d.ts +8 -1
- package/dist/emblems/sport/nba.js +8 -1
- package/dist/emblems/sport/netball.d.ts +8 -1
- package/dist/emblems/sport/netball.js +8 -1
- package/dist/emblems/sport/nfl.d.ts +8 -1
- package/dist/emblems/sport/nfl.js +8 -1
- package/dist/emblems/sport/nhl.d.ts +8 -1
- package/dist/emblems/sport/nhl.js +8 -1
- package/dist/emblems/sport/padel.d.ts +8 -1
- package/dist/emblems/sport/padel.js +8 -1
- package/dist/emblems/sport/pickleball.d.ts +8 -1
- package/dist/emblems/sport/pickleball.js +8 -1
- package/dist/emblems/sport/prowrestling.d.ts +8 -1
- package/dist/emblems/sport/prowrestling.js +8 -1
- package/dist/emblems/sport/racquetball.d.ts +8 -1
- package/dist/emblems/sport/racquetball.js +8 -1
- package/dist/emblems/sport/roundnet.d.ts +8 -1
- package/dist/emblems/sport/roundnet.js +8 -1
- package/dist/emblems/sport/rugby.d.ts +8 -1
- package/dist/emblems/sport/rugby.js +8 -1
- package/dist/emblems/sport/sepaktakraw.d.ts +8 -1
- package/dist/emblems/sport/sepaktakraw.js +8 -1
- package/dist/emblems/sport/skating.d.ts +8 -1
- package/dist/emblems/sport/skating.js +8 -1
- package/dist/emblems/sport/soccer.d.ts +8 -1
- package/dist/emblems/sport/soccer.js +8 -1
- package/dist/emblems/sport/squash.d.ts +8 -1
- package/dist/emblems/sport/squash.js +8 -1
- package/dist/emblems/sport/sumo.d.ts +8 -1
- package/dist/emblems/sport/sumo.js +8 -1
- package/dist/emblems/sport/swimming.d.ts +8 -1
- package/dist/emblems/sport/swimming.js +8 -1
- package/dist/emblems/sport/tabletennis.d.ts +8 -1
- package/dist/emblems/sport/tabletennis.js +8 -1
- package/dist/emblems/sport/tennis.d.ts +8 -1
- package/dist/emblems/sport/tennis.js +8 -1
- package/dist/emblems/sport/teqball.d.ts +8 -1
- package/dist/emblems/sport/teqball.js +8 -1
- package/dist/emblems/sport/volleyball.d.ts +8 -1
- package/dist/emblems/sport/volleyball.js +8 -1
- package/dist/emblems/sport/waterpolo.d.ts +8 -1
- package/dist/emblems/sport/waterpolo.js +8 -1
- package/dist/emblems/sport/wrestling.d.ts +8 -1
- package/dist/emblems/sport/wrestling.js +8 -1
- package/dist/emblems/trophy/americas-cup.d.ts +8 -1
- package/dist/emblems/trophy/americas-cup.js +8 -1
- package/dist/emblems/trophy/art-ross-trophy.d.ts +8 -1
- package/dist/emblems/trophy/art-ross-trophy.js +8 -1
- package/dist/emblems/trophy/ashes-urn.d.ts +8 -1
- package/dist/emblems/trophy/ashes-urn.js +8 -1
- package/dist/emblems/trophy/avco-world-trophy.d.ts +8 -1
- package/dist/emblems/trophy/avco-world-trophy.js +8 -1
- package/dist/emblems/trophy/ballon-dor.d.ts +8 -1
- package/dist/emblems/trophy/ballon-dor.js +8 -1
- package/dist/emblems/trophy/banner.d.ts +8 -1
- package/dist/emblems/trophy/banner.js +8 -1
- package/dist/emblems/trophy/baseball.d.ts +8 -1
- package/dist/emblems/trophy/baseball.js +8 -1
- package/dist/emblems/trophy/basketball.d.ts +8 -1
- package/dist/emblems/trophy/basketball.js +8 -1
- package/dist/emblems/trophy/belt.d.ts +8 -1
- package/dist/emblems/trophy/belt.js +8 -1
- package/dist/emblems/trophy/bill-russell-trophy.d.ts +8 -1
- package/dist/emblems/trophy/bill-russell-trophy.js +8 -1
- package/dist/emblems/trophy/bob-cousy-trophy.d.ts +8 -1
- package/dist/emblems/trophy/bob-cousy-trophy.js +8 -1
- package/dist/emblems/trophy/borg-warner-trophy.d.ts +8 -1
- package/dist/emblems/trophy/borg-warner-trophy.js +8 -1
- package/dist/emblems/trophy/bowl.d.ts +8 -1
- package/dist/emblems/trophy/bowl.js +8 -1
- package/dist/emblems/trophy/calder-cup.d.ts +8 -1
- package/dist/emblems/trophy/calder-cup.js +8 -1
- package/dist/emblems/trophy/calder-trophy.d.ts +8 -1
- package/dist/emblems/trophy/calder-trophy.js +8 -1
- package/dist/emblems/trophy/campbell-bowl.d.ts +8 -1
- package/dist/emblems/trophy/campbell-bowl.js +8 -1
- package/dist/emblems/trophy/canadian-bowl.d.ts +8 -1
- package/dist/emblems/trophy/canadian-bowl.js +8 -1
- package/dist/emblems/trophy/cfp-trophy.d.ts +8 -1
- package/dist/emblems/trophy/cfp-trophy.js +8 -1
- package/dist/emblems/trophy/champions-league-trophy.d.ts +8 -1
- package/dist/emblems/trophy/champions-league-trophy.js +8 -1
- package/dist/emblems/trophy/championship-banner.d.ts +8 -1
- package/dist/emblems/trophy/championship-banner.js +8 -1
- package/dist/emblems/trophy/commissioners-trophy.d.ts +8 -1
- package/dist/emblems/trophy/commissioners-trophy.js +8 -1
- package/dist/emblems/trophy/conn-smythe-trophy.d.ts +8 -1
- package/dist/emblems/trophy/conn-smythe-trophy.js +8 -1
- package/dist/emblems/trophy/cricket-urn.d.ts +8 -1
- package/dist/emblems/trophy/cricket-urn.js +8 -1
- package/dist/emblems/trophy/cricket-world-cup.d.ts +8 -1
- package/dist/emblems/trophy/cricket-world-cup.js +8 -1
- package/dist/emblems/trophy/cup.d.ts +8 -1
- package/dist/emblems/trophy/cup.js +8 -1
- package/dist/emblems/trophy/cy-young-award.d.ts +8 -1
- package/dist/emblems/trophy/cy-young-award.js +8 -1
- package/dist/emblems/trophy/dfb-pokal.d.ts +8 -1
- package/dist/emblems/trophy/dfb-pokal.js +8 -1
- package/dist/emblems/trophy/fa-cup.d.ts +8 -1
- package/dist/emblems/trophy/fa-cup.js +8 -1
- package/dist/emblems/trophy/fifa-world-cup.d.ts +8 -1
- package/dist/emblems/trophy/fifa-world-cup.js +8 -1
- package/dist/emblems/trophy/football.d.ts +8 -1
- package/dist/emblems/trophy/football.js +8 -1
- package/dist/emblems/trophy/foundation-player-award.d.ts +8 -1
- package/dist/emblems/trophy/foundation-player-award.js +8 -1
- package/dist/emblems/trophy/george-halas-trophy.d.ts +8 -1
- package/dist/emblems/trophy/george-halas-trophy.js +8 -1
- package/dist/emblems/trophy/globe.d.ts +8 -1
- package/dist/emblems/trophy/globe.js +8 -1
- package/dist/emblems/trophy/gold-glove-award.d.ts +8 -1
- package/dist/emblems/trophy/gold-glove-award.js +8 -1
- package/dist/emblems/trophy/grey-cup.d.ts +8 -1
- package/dist/emblems/trophy/grey-cup.js +8 -1
- package/dist/emblems/trophy/hank-aaron-award.d.ts +8 -1
- package/dist/emblems/trophy/hank-aaron-award.js +8 -1
- package/dist/emblems/trophy/hart-trophy.d.ts +8 -1
- package/dist/emblems/trophy/hart-trophy.js +8 -1
- package/dist/emblems/trophy/hockey-cup.d.ts +8 -1
- package/dist/emblems/trophy/hockey-cup.js +8 -1
- package/dist/emblems/trophy/jack-adams-trophy.d.ts +8 -1
- package/dist/emblems/trophy/jack-adams-trophy.js +8 -1
- package/dist/emblems/trophy/jackie-robinson-award.d.ts +8 -1
- package/dist/emblems/trophy/jackie-robinson-award.js +8 -1
- package/dist/emblems/trophy/jennings-trophy.d.ts +8 -1
- package/dist/emblems/trophy/jennings-trophy.js +8 -1
- package/dist/emblems/trophy/kelly-cup.d.ts +8 -1
- package/dist/emblems/trophy/kelly-cup.js +8 -1
- package/dist/emblems/trophy/king-clancy-trophy.d.ts +8 -1
- package/dist/emblems/trophy/king-clancy-trophy.js +8 -1
- package/dist/emblems/trophy/lady-byng-trophy.d.ts +8 -1
- package/dist/emblems/trophy/lady-byng-trophy.js +8 -1
- package/dist/emblems/trophy/lamar-hunt-trophy.d.ts +8 -1
- package/dist/emblems/trophy/lamar-hunt-trophy.js +8 -1
- package/dist/emblems/trophy/larry-bird-trophy.d.ts +8 -1
- package/dist/emblems/trophy/larry-bird-trophy.js +8 -1
- package/dist/emblems/trophy/larry-obrien-trophy-1977.d.ts +8 -1
- package/dist/emblems/trophy/larry-obrien-trophy-1977.js +8 -1
- package/dist/emblems/trophy/larry-obrien-trophy.d.ts +8 -1
- package/dist/emblems/trophy/larry-obrien-trophy.js +8 -1
- package/dist/emblems/trophy/laurel.d.ts +8 -1
- package/dist/emblems/trophy/laurel.js +8 -1
- package/dist/emblems/trophy/lester-patrick-trophy.d.ts +8 -1
- package/dist/emblems/trophy/lester-patrick-trophy.js +8 -1
- package/dist/emblems/trophy/lidded-cup.d.ts +8 -1
- package/dist/emblems/trophy/lidded-cup.js +8 -1
- package/dist/emblems/trophy/lombardi-trophy.d.ts +8 -1
- package/dist/emblems/trophy/lombardi-trophy.js +8 -1
- package/dist/emblems/trophy/magic-johnson-trophy.d.ts +8 -1
- package/dist/emblems/trophy/magic-johnson-trophy.js +8 -1
- package/dist/emblems/trophy/masterton-trophy.d.ts +8 -1
- package/dist/emblems/trophy/masterton-trophy.js +8 -1
- package/dist/emblems/trophy/messier-leadership-award.d.ts +8 -1
- package/dist/emblems/trophy/messier-leadership-award.js +8 -1
- package/dist/emblems/trophy/mlb-mvp-award.d.ts +8 -1
- package/dist/emblems/trophy/mlb-mvp-award.js +8 -1
- package/dist/emblems/trophy/mls-cup.d.ts +8 -1
- package/dist/emblems/trophy/mls-cup.js +8 -1
- package/dist/emblems/trophy/nba-eastern-conference-2001.d.ts +8 -1
- package/dist/emblems/trophy/nba-eastern-conference-2001.js +8 -1
- package/dist/emblems/trophy/nba-western-conference-2001.d.ts +8 -1
- package/dist/emblems/trophy/nba-western-conference-2001.js +8 -1
- package/dist/emblems/trophy/norris-trophy.d.ts +8 -1
- package/dist/emblems/trophy/norris-trophy.js +8 -1
- package/dist/emblems/trophy/obrien-cup.d.ts +8 -1
- package/dist/emblems/trophy/obrien-cup.js +8 -1
- package/dist/emblems/trophy/oscar-robertson-trophy.d.ts +8 -1
- package/dist/emblems/trophy/oscar-robertson-trophy.js +8 -1
- package/dist/emblems/trophy/paterson-cup.d.ts +8 -1
- package/dist/emblems/trophy/paterson-cup.js +8 -1
- package/dist/emblems/trophy/plaque.d.ts +8 -1
- package/dist/emblems/trophy/plaque.js +8 -1
- package/dist/emblems/trophy/presidents-trophy.d.ts +8 -1
- package/dist/emblems/trophy/presidents-trophy.js +8 -1
- package/dist/emblems/trophy/prince-of-wales-trophy.d.ts +8 -1
- package/dist/emblems/trophy/prince-of-wales-trophy.js +8 -1
- package/dist/emblems/trophy/relief-man-award.d.ts +8 -1
- package/dist/emblems/trophy/relief-man-award.js +8 -1
- package/dist/emblems/trophy/ring.d.ts +8 -1
- package/dist/emblems/trophy/ring.js +8 -1
- package/dist/emblems/trophy/rocket-richard-trophy.d.ts +8 -1
- package/dist/emblems/trophy/rocket-richard-trophy.js +8 -1
- package/dist/emblems/trophy/rosette.d.ts +8 -1
- package/dist/emblems/trophy/rosette.js +8 -1
- package/dist/emblems/trophy/rugby-cup.d.ts +8 -1
- package/dist/emblems/trophy/rugby-cup.js +8 -1
- package/dist/emblems/trophy/salver.d.ts +8 -1
- package/dist/emblems/trophy/salver.js +8 -1
- package/dist/emblems/trophy/selke-trophy.d.ts +8 -1
- package/dist/emblems/trophy/selke-trophy.js +8 -1
- package/dist/emblems/trophy/silver-slugger-award.d.ts +8 -1
- package/dist/emblems/trophy/silver-slugger-award.js +8 -1
- package/dist/emblems/trophy/soccer-ball.d.ts +8 -1
- package/dist/emblems/trophy/soccer-ball.js +8 -1
- package/dist/emblems/trophy/soccer-globe.d.ts +8 -1
- package/dist/emblems/trophy/soccer-globe.js +8 -1
- package/dist/emblems/trophy/stanley-cup.d.ts +8 -1
- package/dist/emblems/trophy/stanley-cup.js +8 -1
- package/dist/emblems/trophy/sumo-cup.d.ts +8 -1
- package/dist/emblems/trophy/sumo-cup.js +8 -1
- package/dist/emblems/trophy/ted-lindsay-award.d.ts +8 -1
- package/dist/emblems/trophy/ted-lindsay-award.js +8 -1
- package/dist/emblems/trophy/tennis-cup.d.ts +8 -1
- package/dist/emblems/trophy/tennis-cup.js +8 -1
- package/dist/emblems/trophy/tennis-plate.d.ts +8 -1
- package/dist/emblems/trophy/tennis-plate.js +8 -1
- package/dist/emblems/trophy/venus-rosewater-dish.d.ts +8 -1
- package/dist/emblems/trophy/venus-rosewater-dish.js +8 -1
- package/dist/emblems/trophy/vezina-trophy.d.ts +8 -1
- package/dist/emblems/trophy/vezina-trophy.js +8 -1
- package/dist/emblems/trophy/walter-cup.d.ts +8 -1
- package/dist/emblems/trophy/walter-cup.js +8 -1
- package/dist/emblems/trophy/webb-ellis-cup.d.ts +8 -1
- package/dist/emblems/trophy/webb-ellis-cup.js +8 -1
- package/dist/emblems/trophy/willie-oree-award.d.ts +8 -1
- package/dist/emblems/trophy/willie-oree-award.js +8 -1
- package/dist/emblems/trophy/wimbledon-gentlemens-trophy.d.ts +8 -1
- package/dist/emblems/trophy/wimbledon-gentlemens-trophy.js +8 -1
- package/dist/emblems/trophy/wnba-championship-trophy.d.ts +8 -1
- package/dist/emblems/trophy/wnba-championship-trophy.js +8 -1
- package/dist/emblems/trophy/woodlawn-vase.d.ts +8 -1
- package/dist/emblems/trophy/woodlawn-vase.js +8 -1
- package/dist/emblems/trophy/world-series-mvp-trophy.d.ts +8 -1
- package/dist/emblems/trophy/world-series-mvp-trophy.js +8 -1
- package/dist/emblems-entry.d.ts +2 -0
- package/dist/emblems-entry.js +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/turn-control.d.ts +72 -7
- package/dist/turn-control.js +22 -3
- package/dist/turn-full.d.ts +5 -1
- package/dist/turn-full.js +5 -1
- package/dist/version.d.ts +9 -1
- package/dist/version.js +9 -1
- package/package.json +37 -7
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* A round badge with a ring inside its edge.
|
|
3
|
+
* @example
|
|
4
|
+
* ```ts
|
|
5
|
+
* import { CREST_ROUNDEL } from "@johnmorrisdotca/dougu-sports";
|
|
6
|
+
* console.log(CREST_ROUNDEL.id, CREST_ROUNDEL.svg({ size: 48 }).startsWith("<svg"));
|
|
7
|
+
* ```
|
|
8
|
+
*/
|
|
2
9
|
export declare const CREST_ROUNDEL: import("../emblem.core.ts").Emblem<import("../emblem.shapes.ts").FlatModel>;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
// A round badge with a ring inside its edge, tinted by a team's colours, with the team's letters on it or a star. Drawn for this package.
|
|
2
2
|
import { circlePath, defineFlat, starPath } from "../emblem.shapes.js";
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* A round badge with a ring inside its edge.
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { CREST_ROUNDEL } from "@johnmorrisdotca/dougu-sports";
|
|
8
|
+
* console.log(CREST_ROUNDEL.id, CREST_ROUNDEL.svg({ size: 48 }).startsWith("<svg"));
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
4
11
|
export const CREST_ROUNDEL = /* @__PURE__ */ defineFlat("crest:roundel", "Round crest", "丸形のエンブレム", "ours", {
|
|
5
12
|
metal: "flat",
|
|
6
13
|
color: "#2d5a8c",
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* A heraldic shield with a band across the top.
|
|
3
|
+
* @example
|
|
4
|
+
* ```ts
|
|
5
|
+
* import { CREST_SHIELD } from "@johnmorrisdotca/dougu-sports";
|
|
6
|
+
* console.log(CREST_SHIELD.id, CREST_SHIELD.svg({ size: 48 }).startsWith("<svg"));
|
|
7
|
+
* ```
|
|
8
|
+
*/
|
|
2
9
|
export declare const CREST_SHIELD: import("../emblem.core.ts").Emblem<import("../emblem.shapes.ts").FlatModel>;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
// A heraldic shield with a band across the top, tinted by a team's colours, with the team's letters on it or a star. Drawn for this package.
|
|
2
2
|
import { defineFlat, starPath } from "../emblem.shapes.js";
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* A heraldic shield with a band across the top.
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { CREST_SHIELD } from "@johnmorrisdotca/dougu-sports";
|
|
8
|
+
* console.log(CREST_SHIELD.id, CREST_SHIELD.svg({ size: 48 }).startsWith("<svg"));
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
4
11
|
export const CREST_SHIELD = /* @__PURE__ */ defineFlat("crest:shield", "Shield crest", "盾形のエンブレム", "ours", {
|
|
5
12
|
metal: "flat",
|
|
6
13
|
color: "#2d5a8c",
|
|
@@ -2,16 +2,53 @@ import type { Emblem, EmblemLocale, EmblemOptions, EmblemStyle, EmblemTheme, Fra
|
|
|
2
2
|
import { type BallId, type PuckId, type CrestShape, type EmblemId, type MedalKind, type SportName } from "./emblem.ids.ts";
|
|
3
3
|
import type { PieceSize } from "./ball/ball.core.ts";
|
|
4
4
|
import { type EmblemDescription } from "./emblem.descriptions.ts";
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* What can name an emblem: an id, a short name (`"cup"` for `"trophy:cup"`), either with a style (`"trophy:cup/line"`), or the emblem itself.
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { renderEmblem } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
10
|
+
* import type { EmblemRef } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
11
|
+
* const refs: EmblemRef[] = ["trophy:cup", "cup/line", "medal:gold"];
|
|
12
|
+
* console.log(refs.map((ref) => renderEmblem(ref).length > 0));
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
6
15
|
export type EmblemRef = EmblemId | `${EmblemId}/${EmblemStyle}` | (string & {}) | Emblem;
|
|
7
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* The id and style a string names, or `undefined` when it is not an emblem. An id may end in `/metal`, `/line` or `/color`, and a trophy or an award may be written without its group (`cup`, `crown`).
|
|
18
|
+
* @param value - Anything; a string may be an id, a short name, or either with a `/metal`, `/line` or `/color` style.
|
|
19
|
+
* @returns The id and style the string names, or `undefined` when it names no emblem.
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* import { parseEmblem } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
23
|
+
* console.log(parseEmblem("cup/line"), parseEmblem("nothing"));
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
8
26
|
export declare function parseEmblem(value: unknown): {
|
|
9
27
|
id: EmblemId;
|
|
10
28
|
style: EmblemStyle | undefined;
|
|
11
29
|
} | undefined;
|
|
12
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* True when the value is the id of an emblem (not a short name, and with no style).
|
|
32
|
+
* @param value - Anything.
|
|
33
|
+
* @returns True when the value is the id of an emblem, false for anything else.
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* import { isEmblemId } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
37
|
+
* console.log(isEmblemId("trophy:cup"), isEmblemId("cup"));
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
13
40
|
export declare function isEmblemId(value: unknown): value is EmblemId;
|
|
14
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* The emblem a reference names. An unknown name is an error that says what an id looks like.
|
|
43
|
+
* @param ref - An id, a short name, an id with a style, or an emblem.
|
|
44
|
+
* @returns The emblem the reference names and the style it asks for (`undefined` when it names none). An unknown name throws.
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* import { emblemOf } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
48
|
+
* const { emblem, style } = emblemOf("trophy:cup/line");
|
|
49
|
+
* console.log(emblem.id, style);
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
15
52
|
export declare function emblemOf(ref: EmblemRef): {
|
|
16
53
|
emblem: Emblem;
|
|
17
54
|
style: EmblemStyle | undefined;
|
|
@@ -19,6 +56,9 @@ export declare function emblemOf(ref: EmblemRef): {
|
|
|
19
56
|
/**
|
|
20
57
|
* An emblem as a document of SVG: `renderEmblem("award:medal")`, `renderEmblem("ball:soccer/line", { size: 20 })`. `style` is `metal` (full colour with gradients, the default), `line` (one outline in the
|
|
21
58
|
* page's text colour) or `color` (flat fills); `tint` replaces the main colour; `theme` is `inherit` (the default), `auto`, `light` or `dark`. A pure function: the same arguments give the same string.
|
|
59
|
+
* @param ref - An id, a short name, an id with a style, or an emblem.
|
|
60
|
+
* @param options - The style, size, tint, theme, labels and other emblem options.
|
|
61
|
+
* @returns The emblem as a document of SVG.
|
|
22
62
|
* @example
|
|
23
63
|
* ```ts
|
|
24
64
|
* import { renderEmblem } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
@@ -28,25 +68,74 @@ export declare function emblemOf(ref: EmblemRef): {
|
|
|
28
68
|
* ```
|
|
29
69
|
*/
|
|
30
70
|
export declare function renderEmblem(ref: EmblemRef, options?: EmblemOptions): string;
|
|
31
|
-
/**
|
|
71
|
+
/**
|
|
72
|
+
* The same as `renderEmblem`.
|
|
73
|
+
* @param ref - An id, a short name, an id with a style, or an emblem.
|
|
74
|
+
* @param options - The size, style, tint and the other emblem options.
|
|
75
|
+
* @returns A document of SVG.
|
|
76
|
+
* @example
|
|
77
|
+
* ```ts
|
|
78
|
+
* import { emblemSvg } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
79
|
+
* console.log(emblemSvg("medal:gold", { size: 32 }).startsWith("<svg"));
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
32
82
|
export declare const emblemSvg: typeof renderEmblem;
|
|
33
83
|
/**
|
|
34
84
|
* An emblem turned: `yaw` degrees about its vertical axis and `pitch` degrees of tilt, from its resting view, in plain SVG. A cup, bowl or urn keeps its outline and moves its light, handles and seams; a medal flips like a coin and shows its back; a ball rolls; an icon is not turned.
|
|
85
|
+
* @param ref - An id, a short name, an id with a style, or an emblem.
|
|
86
|
+
* @param options - The turn (`yaw`, `pitch`, `roll`) and the emblem options.
|
|
87
|
+
* @returns The turned emblem as a document of SVG.
|
|
35
88
|
* @example
|
|
36
89
|
* ```ts
|
|
37
|
-
* import { emblemFrame
|
|
90
|
+
* import { emblemFrame } from "@johnmorrisdotca/dougu-sports/turn";
|
|
91
|
+
* import { renderEmblem } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
38
92
|
* console.log(emblemFrame("medal:gold", { yaw: 0 }) === renderEmblem("medal:gold"));
|
|
39
93
|
* // true
|
|
40
94
|
* ```
|
|
41
95
|
*/
|
|
42
96
|
export declare function emblemFrame(ref: EmblemRef, options?: FrameOptions): string;
|
|
43
|
-
/**
|
|
97
|
+
/**
|
|
98
|
+
* Whether a value is the id of a ball (a printed puck, `puck:canada`, is a ball too).
|
|
99
|
+
* @param value - Anything.
|
|
100
|
+
* @returns True when the value is the id of a ball (a printed puck included), false for anything else.
|
|
101
|
+
* @example
|
|
102
|
+
* ```ts
|
|
103
|
+
* import { isBallId } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
104
|
+
* console.log(isBallId("ball:soccer"), isBallId("trophy:cup"));
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
44
107
|
export declare const isBallId: (value: unknown) => value is BallId | PuckId;
|
|
45
|
-
/**
|
|
108
|
+
/**
|
|
109
|
+
* A ball rolled: the same as `emblemFrame`, for a ball's id only (a printed puck's too). A value that is not a ball is an error.
|
|
110
|
+
* @param id - A ball id or a printed puck's id.
|
|
111
|
+
* @param options - The turn (`yaw`, `pitch`, `roll`) and the emblem options.
|
|
112
|
+
* @returns The turned ball as a document of SVG.
|
|
113
|
+
* @example
|
|
114
|
+
* ```ts
|
|
115
|
+
* import { ballFrame } from "@johnmorrisdotca/dougu-sports/turn";
|
|
116
|
+
* console.log(ballFrame("ball:soccer", { yaw: 30, roll: 10 }).startsWith("<svg"));
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
46
119
|
export declare function ballFrame(id: BallId | PuckId, options?: FrameOptions): string;
|
|
47
|
-
/**
|
|
120
|
+
/**
|
|
121
|
+
* Every emblem as markup in the metal style at 64 pixels, by id. Use `renderEmblem` for another style or size.
|
|
122
|
+
* @example
|
|
123
|
+
* ```ts
|
|
124
|
+
* import { EMBLEMS } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
125
|
+
* console.log(Object.keys(EMBLEMS).length);
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
48
128
|
export declare const EMBLEMS: Readonly<Record<EmblemId, string>>;
|
|
49
|
-
/**
|
|
129
|
+
/**
|
|
130
|
+
* What an emblem is, without its drawing.
|
|
131
|
+
* @example
|
|
132
|
+
* ```ts
|
|
133
|
+
* import { emblemInfo } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
134
|
+
* import type { EmblemInfo } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
135
|
+
* const info: EmblemInfo = emblemInfo("medal:gold");
|
|
136
|
+
* console.log(info.id, info.kind);
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
50
139
|
export interface EmblemInfo {
|
|
51
140
|
id: EmblemId;
|
|
52
141
|
en: string;
|
|
@@ -58,13 +147,52 @@ export interface EmblemInfo {
|
|
|
58
147
|
/** What is drawn, in more words than the short name (which is the accessible name), for the docs and a gallery; not every emblem has one. */
|
|
59
148
|
description?: EmblemDescription;
|
|
60
149
|
}
|
|
61
|
-
/**
|
|
150
|
+
/**
|
|
151
|
+
* The names, source and kind of an emblem.
|
|
152
|
+
* @param id - An emblem id, such as `ball:soccer`.
|
|
153
|
+
* @returns The emblem's id, names, source and kind, with its official size and description where it has them.
|
|
154
|
+
* @example
|
|
155
|
+
* ```ts
|
|
156
|
+
* import { emblemInfo } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
157
|
+
* const info = emblemInfo("ball:soccer");
|
|
158
|
+
* console.log(info.en, info.kind, info.size?.diameterMm);
|
|
159
|
+
* ```
|
|
160
|
+
*/
|
|
62
161
|
export declare function emblemInfo(id: EmblemId): EmblemInfo;
|
|
63
|
-
/**
|
|
162
|
+
/**
|
|
163
|
+
* An emblem's name in a language.
|
|
164
|
+
* @param id - An emblem id.
|
|
165
|
+
* @param language - `en` (the default) or `ja`.
|
|
166
|
+
* @returns The emblem's name in that language.
|
|
167
|
+
* @example
|
|
168
|
+
* ```ts
|
|
169
|
+
* import { emblemName } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
170
|
+
* console.log(emblemName("trophy:cup"), emblemName("trophy:cup", "ja"));
|
|
171
|
+
* ```
|
|
172
|
+
*/
|
|
64
173
|
export declare function emblemName(id: EmblemId, language?: "en" | "ja"): string;
|
|
65
|
-
/**
|
|
174
|
+
/**
|
|
175
|
+
* The data an emblem is drawn from: a flat emblem's shapes or a ball's marks, for a view that turns it itself.
|
|
176
|
+
* @param id - An emblem id.
|
|
177
|
+
* @returns The emblem's model: a flat emblem's shapes or a body of revolution's profile, whichever the emblem is made of.
|
|
178
|
+
* @example
|
|
179
|
+
* ```ts
|
|
180
|
+
* import { emblemModel } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
181
|
+
* const model = emblemModel("medal:gold") as { front: unknown[] };
|
|
182
|
+
* console.log(model.front.length > 0);
|
|
183
|
+
* ```
|
|
184
|
+
*/
|
|
66
185
|
export declare function emblemModel(id: EmblemId): unknown;
|
|
67
|
-
/**
|
|
186
|
+
/**
|
|
187
|
+
* What `crest` takes.
|
|
188
|
+
* @example
|
|
189
|
+
* ```ts
|
|
190
|
+
* import { crest } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
191
|
+
* import type { CrestOptions } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
192
|
+
* const options: CrestOptions = { shape: "roundel", colors: ["#1f4e8c", "#f2c230"], initials: "AB" };
|
|
193
|
+
* console.log(crest(options).startsWith("<svg"));
|
|
194
|
+
* ```
|
|
195
|
+
*/
|
|
68
196
|
export interface CrestOptions {
|
|
69
197
|
/** `shield` (the default), `roundel`, `diamond` or `pennant`. */
|
|
70
198
|
shape?: CrestShape;
|
|
@@ -82,6 +210,8 @@ export interface CrestOptions {
|
|
|
82
210
|
}
|
|
83
211
|
/**
|
|
84
212
|
* A generic crest tinted by a team's colours, with its letters if it has any: what a team with no logo gets. The letters are in the ink that reads on the colour.
|
|
213
|
+
* @param options - The shape, colours and initials; every field is optional.
|
|
214
|
+
* @returns The crest as a document of SVG.
|
|
85
215
|
* @example
|
|
86
216
|
* ```ts
|
|
87
217
|
* import { crest } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
@@ -91,11 +221,40 @@ export interface CrestOptions {
|
|
|
91
221
|
* ```
|
|
92
222
|
*/
|
|
93
223
|
export declare function crest(options?: CrestOptions): string;
|
|
94
|
-
/**
|
|
224
|
+
/**
|
|
225
|
+
* A medal on a ribbon: `medal("gold")`, `"silver"` or `"bronze"`; any other kind is the gold one.
|
|
226
|
+
* @param kind - `gold`, `silver` or `bronze`.
|
|
227
|
+
* @param options - The emblem options.
|
|
228
|
+
* @returns The medal as a document of SVG.
|
|
229
|
+
* @example
|
|
230
|
+
* ```ts
|
|
231
|
+
* import { medal } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
232
|
+
* console.log(medal("silver", { size: 48 }).startsWith("<svg"));
|
|
233
|
+
* ```
|
|
234
|
+
*/
|
|
95
235
|
export declare function medal(kind: MedalKind, options?: EmblemOptions): string;
|
|
96
|
-
/**
|
|
236
|
+
/**
|
|
237
|
+
* The icon of a sport, by the names of `SPORT_NAMES`: `sportIcon("nhl")`. An unknown sport is an error.
|
|
238
|
+
* @param sport - A name from `SPORT_NAMES`, such as `nhl`.
|
|
239
|
+
* @param options - The emblem options.
|
|
240
|
+
* @returns The sport's icon as a document of SVG.
|
|
241
|
+
* @example
|
|
242
|
+
* ```ts
|
|
243
|
+
* import { sportIcon } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
244
|
+
* console.log(sportIcon("nhl", { size: 32 }).startsWith("<svg"));
|
|
245
|
+
* ```
|
|
246
|
+
*/
|
|
97
247
|
export declare function sportIcon(sport: SportName, options?: EmblemOptions): string;
|
|
98
|
-
/**
|
|
248
|
+
/**
|
|
249
|
+
* What `pennant` takes.
|
|
250
|
+
* @example
|
|
251
|
+
* ```ts
|
|
252
|
+
* import { pennant } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
253
|
+
* import type { PennantOptions } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
254
|
+
* const options: PennantOptions = { text: "Winners", year: 2026, view: "back" };
|
|
255
|
+
* console.log(pennant(options).startsWith("<svg"));
|
|
256
|
+
* ```
|
|
257
|
+
*/
|
|
99
258
|
export interface PennantOptions {
|
|
100
259
|
/** The felt, the stitching, and the lettering (the stitching's colour unless a third is given), as hex colours or `rgb()`. */
|
|
101
260
|
colors?: string | readonly [felt?: string, stitching?: string, lettering?: string];
|
|
@@ -117,6 +276,8 @@ export interface PennantOptions {
|
|
|
117
276
|
}
|
|
118
277
|
/**
|
|
119
278
|
* A felt championship pennant with a stitched edge, lettered with its words and its year.
|
|
279
|
+
* @param options - The colours, words, year and view; every field is optional.
|
|
280
|
+
* @returns The pennant as a document of SVG.
|
|
120
281
|
* @example
|
|
121
282
|
* ```ts
|
|
122
283
|
* import { pennant } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
@@ -2,7 +2,16 @@ import { EMBLEM_STYLES } from "./emblem.core.js";
|
|
|
2
2
|
import { BALL_IDS, CREST_SHAPES, EMBLEM_ALIASES, EMBLEM_IDS, PUCK_IDS } from "./emblem.ids.js";
|
|
3
3
|
import { EMBLEM_DESCRIPTIONS } from "./emblem.descriptions.js";
|
|
4
4
|
import { EMBLEM_TABLE } from "./emblem.registry.js";
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* The id and style a string names, or `undefined` when it is not an emblem. An id may end in `/metal`, `/line` or `/color`, and a trophy or an award may be written without its group (`cup`, `crown`).
|
|
7
|
+
* @param value - Anything; a string may be an id, a short name, or either with a `/metal`, `/line` or `/color` style.
|
|
8
|
+
* @returns The id and style the string names, or `undefined` when it names no emblem.
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { parseEmblem } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
12
|
+
* console.log(parseEmblem("cup/line"), parseEmblem("nothing"));
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
6
15
|
export function parseEmblem(value) {
|
|
7
16
|
if (typeof value !== "string")
|
|
8
17
|
return undefined;
|
|
@@ -21,11 +30,30 @@ export function parseEmblem(value) {
|
|
|
21
30
|
const id = Object.hasOwn(EMBLEM_ALIASES, text) ? EMBLEM_ALIASES[text] : text;
|
|
22
31
|
return Object.hasOwn(EMBLEM_TABLE, id) ? { id: id, style } : undefined;
|
|
23
32
|
}
|
|
24
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* True when the value is the id of an emblem (not a short name, and with no style).
|
|
35
|
+
* @param value - Anything.
|
|
36
|
+
* @returns True when the value is the id of an emblem, false for anything else.
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* import { isEmblemId } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
40
|
+
* console.log(isEmblemId("trophy:cup"), isEmblemId("cup"));
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
25
43
|
export function isEmblemId(value) {
|
|
26
44
|
return typeof value === "string" && Object.hasOwn(EMBLEM_TABLE, value);
|
|
27
45
|
}
|
|
28
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* The emblem a reference names. An unknown name is an error that says what an id looks like.
|
|
48
|
+
* @param ref - An id, a short name, an id with a style, or an emblem.
|
|
49
|
+
* @returns The emblem the reference names and the style it asks for (`undefined` when it names none). An unknown name throws.
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* import { emblemOf } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
53
|
+
* const { emblem, style } = emblemOf("trophy:cup/line");
|
|
54
|
+
* console.log(emblem.id, style);
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
29
57
|
export function emblemOf(ref) {
|
|
30
58
|
if (typeof ref !== "string")
|
|
31
59
|
return { emblem: ref, style: undefined };
|
|
@@ -54,6 +82,9 @@ function printed(emblem, options) {
|
|
|
54
82
|
/**
|
|
55
83
|
* An emblem as a document of SVG: `renderEmblem("award:medal")`, `renderEmblem("ball:soccer/line", { size: 20 })`. `style` is `metal` (full colour with gradients, the default), `line` (one outline in the
|
|
56
84
|
* page's text colour) or `color` (flat fills); `tint` replaces the main colour; `theme` is `inherit` (the default), `auto`, `light` or `dark`. A pure function: the same arguments give the same string.
|
|
85
|
+
* @param ref - An id, a short name, an id with a style, or an emblem.
|
|
86
|
+
* @param options - The style, size, tint, theme, labels and other emblem options.
|
|
87
|
+
* @returns The emblem as a document of SVG.
|
|
57
88
|
* @example
|
|
58
89
|
* ```ts
|
|
59
90
|
* import { renderEmblem } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
@@ -67,13 +98,27 @@ export function renderEmblem(ref, options) {
|
|
|
67
98
|
const p = printed(emblem, withStyle(style, options));
|
|
68
99
|
return p.emblem.svg(p.options);
|
|
69
100
|
}
|
|
70
|
-
/**
|
|
101
|
+
/**
|
|
102
|
+
* The same as `renderEmblem`.
|
|
103
|
+
* @param ref - An id, a short name, an id with a style, or an emblem.
|
|
104
|
+
* @param options - The size, style, tint and the other emblem options.
|
|
105
|
+
* @returns A document of SVG.
|
|
106
|
+
* @example
|
|
107
|
+
* ```ts
|
|
108
|
+
* import { emblemSvg } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
109
|
+
* console.log(emblemSvg("medal:gold", { size: 32 }).startsWith("<svg"));
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
71
112
|
export const emblemSvg = renderEmblem;
|
|
72
113
|
/**
|
|
73
114
|
* An emblem turned: `yaw` degrees about its vertical axis and `pitch` degrees of tilt, from its resting view, in plain SVG. A cup, bowl or urn keeps its outline and moves its light, handles and seams; a medal flips like a coin and shows its back; a ball rolls; an icon is not turned.
|
|
115
|
+
* @param ref - An id, a short name, an id with a style, or an emblem.
|
|
116
|
+
* @param options - The turn (`yaw`, `pitch`, `roll`) and the emblem options.
|
|
117
|
+
* @returns The turned emblem as a document of SVG.
|
|
74
118
|
* @example
|
|
75
119
|
* ```ts
|
|
76
|
-
* import { emblemFrame
|
|
120
|
+
* import { emblemFrame } from "@johnmorrisdotca/dougu-sports/turn";
|
|
121
|
+
* import { renderEmblem } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
77
122
|
* console.log(emblemFrame("medal:gold", { yaw: 0 }) === renderEmblem("medal:gold"));
|
|
78
123
|
* // true
|
|
79
124
|
* ```
|
|
@@ -83,34 +128,92 @@ export function emblemFrame(ref, options) {
|
|
|
83
128
|
const p = printed(emblem, withStyle(style, options));
|
|
84
129
|
return p.emblem.frame(p.options);
|
|
85
130
|
}
|
|
86
|
-
/**
|
|
131
|
+
/**
|
|
132
|
+
* Whether a value is the id of a ball (a printed puck, `puck:canada`, is a ball too).
|
|
133
|
+
* @param value - Anything.
|
|
134
|
+
* @returns True when the value is the id of a ball (a printed puck included), false for anything else.
|
|
135
|
+
* @example
|
|
136
|
+
* ```ts
|
|
137
|
+
* import { isBallId } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
138
|
+
* console.log(isBallId("ball:soccer"), isBallId("trophy:cup"));
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
87
141
|
export const isBallId = (value) => typeof value === "string" && (BALL_IDS.includes(value) || PUCK_IDS.includes(value));
|
|
88
|
-
/**
|
|
142
|
+
/**
|
|
143
|
+
* A ball rolled: the same as `emblemFrame`, for a ball's id only (a printed puck's too). A value that is not a ball is an error.
|
|
144
|
+
* @param id - A ball id or a printed puck's id.
|
|
145
|
+
* @param options - The turn (`yaw`, `pitch`, `roll`) and the emblem options.
|
|
146
|
+
* @returns The turned ball as a document of SVG.
|
|
147
|
+
* @example
|
|
148
|
+
* ```ts
|
|
149
|
+
* import { ballFrame } from "@johnmorrisdotca/dougu-sports/turn";
|
|
150
|
+
* console.log(ballFrame("ball:soccer", { yaw: 30, roll: 10 }).startsWith("<svg"));
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
89
153
|
export function ballFrame(id, options) {
|
|
90
154
|
if (!isBallId(id))
|
|
91
155
|
throw new Error(`"${String(id).slice(0, 60)}" is not a ball: ids look like "ball:soccer" or "puck:canada"; see BALL_IDS and PUCK_IDS.`);
|
|
92
156
|
const p = printed(EMBLEM_TABLE[id], options);
|
|
93
157
|
return p.emblem.frame(p.options);
|
|
94
158
|
}
|
|
95
|
-
/**
|
|
159
|
+
/**
|
|
160
|
+
* Every emblem as markup in the metal style at 64 pixels, by id. Use `renderEmblem` for another style or size.
|
|
161
|
+
* @example
|
|
162
|
+
* ```ts
|
|
163
|
+
* import { EMBLEMS } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
164
|
+
* console.log(Object.keys(EMBLEMS).length);
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
96
167
|
export const EMBLEMS = Object.freeze(Object.fromEntries(EMBLEM_IDS.map((id) => [id, EMBLEM_TABLE[id].svg()])));
|
|
97
|
-
/**
|
|
168
|
+
/**
|
|
169
|
+
* The names, source and kind of an emblem.
|
|
170
|
+
* @param id - An emblem id, such as `ball:soccer`.
|
|
171
|
+
* @returns The emblem's id, names, source and kind, with its official size and description where it has them.
|
|
172
|
+
* @example
|
|
173
|
+
* ```ts
|
|
174
|
+
* import { emblemInfo } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
175
|
+
* const info = emblemInfo("ball:soccer");
|
|
176
|
+
* console.log(info.en, info.kind, info.size?.diameterMm);
|
|
177
|
+
* ```
|
|
178
|
+
*/
|
|
98
179
|
export function emblemInfo(id) {
|
|
99
180
|
const e = EMBLEM_TABLE[id];
|
|
100
181
|
const size = e.size;
|
|
101
182
|
const description = EMBLEM_DESCRIPTIONS[id];
|
|
102
183
|
return { id, en: e.en, ja: e.ja, source: e.source, kind: e.kind, ...(size === undefined ? {} : { size }), ...(description === undefined ? {} : { description }) };
|
|
103
184
|
}
|
|
104
|
-
/**
|
|
185
|
+
/**
|
|
186
|
+
* An emblem's name in a language.
|
|
187
|
+
* @param id - An emblem id.
|
|
188
|
+
* @param language - `en` (the default) or `ja`.
|
|
189
|
+
* @returns The emblem's name in that language.
|
|
190
|
+
* @example
|
|
191
|
+
* ```ts
|
|
192
|
+
* import { emblemName } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
193
|
+
* console.log(emblemName("trophy:cup"), emblemName("trophy:cup", "ja"));
|
|
194
|
+
* ```
|
|
195
|
+
*/
|
|
105
196
|
export function emblemName(id, language = "en") {
|
|
106
197
|
return language === "ja" ? EMBLEM_TABLE[id].ja : EMBLEM_TABLE[id].en;
|
|
107
198
|
}
|
|
108
|
-
/**
|
|
199
|
+
/**
|
|
200
|
+
* The data an emblem is drawn from: a flat emblem's shapes or a ball's marks, for a view that turns it itself.
|
|
201
|
+
* @param id - An emblem id.
|
|
202
|
+
* @returns The emblem's model: a flat emblem's shapes or a body of revolution's profile, whichever the emblem is made of.
|
|
203
|
+
* @example
|
|
204
|
+
* ```ts
|
|
205
|
+
* import { emblemModel } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
206
|
+
* const model = emblemModel("medal:gold") as { front: unknown[] };
|
|
207
|
+
* console.log(model.front.length > 0);
|
|
208
|
+
* ```
|
|
209
|
+
*/
|
|
109
210
|
export function emblemModel(id) {
|
|
110
211
|
return EMBLEM_TABLE[id].model;
|
|
111
212
|
}
|
|
112
213
|
/**
|
|
113
214
|
* A generic crest tinted by a team's colours, with its letters if it has any: what a team with no logo gets. The letters are in the ink that reads on the colour.
|
|
215
|
+
* @param options - The shape, colours and initials; every field is optional.
|
|
216
|
+
* @returns The crest as a document of SVG.
|
|
114
217
|
* @example
|
|
115
218
|
* ```ts
|
|
116
219
|
* import { crest } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
@@ -124,11 +227,31 @@ export function crest(options = {}) {
|
|
|
124
227
|
const shape = CREST_SHAPES.includes(options.shape) ? options.shape : "shield";
|
|
125
228
|
return EMBLEM_TABLE[`crest:${shape}`].svg({ tint: colors[0], accent: colors[1], initials: options.initials, size: options.size, style: options.style, theme: options.theme, locale: options.locale, title: options.title });
|
|
126
229
|
}
|
|
127
|
-
/**
|
|
230
|
+
/**
|
|
231
|
+
* A medal on a ribbon: `medal("gold")`, `"silver"` or `"bronze"`; any other kind is the gold one.
|
|
232
|
+
* @param kind - `gold`, `silver` or `bronze`.
|
|
233
|
+
* @param options - The emblem options.
|
|
234
|
+
* @returns The medal as a document of SVG.
|
|
235
|
+
* @example
|
|
236
|
+
* ```ts
|
|
237
|
+
* import { medal } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
238
|
+
* console.log(medal("silver", { size: 48 }).startsWith("<svg"));
|
|
239
|
+
* ```
|
|
240
|
+
*/
|
|
128
241
|
export function medal(kind, options) {
|
|
129
242
|
return (EMBLEM_TABLE[`medal:${kind}`] ?? EMBLEM_TABLE["medal:gold"]).svg(options);
|
|
130
243
|
}
|
|
131
|
-
/**
|
|
244
|
+
/**
|
|
245
|
+
* The icon of a sport, by the names of `SPORT_NAMES`: `sportIcon("nhl")`. An unknown sport is an error.
|
|
246
|
+
* @param sport - A name from `SPORT_NAMES`, such as `nhl`.
|
|
247
|
+
* @param options - The emblem options.
|
|
248
|
+
* @returns The sport's icon as a document of SVG.
|
|
249
|
+
* @example
|
|
250
|
+
* ```ts
|
|
251
|
+
* import { sportIcon } from "@johnmorrisdotca/dougu-sports/emblems";
|
|
252
|
+
* console.log(sportIcon("nhl", { size: 32 }).startsWith("<svg"));
|
|
253
|
+
* ```
|
|
254
|
+
*/
|
|
132
255
|
export function sportIcon(sport, options) {
|
|
133
256
|
const e = Object.hasOwn(EMBLEM_TABLE, `sport:${sport}`) ? EMBLEM_TABLE[`sport:${sport}`] : undefined;
|
|
134
257
|
if (e === undefined)
|
|
@@ -137,6 +260,8 @@ export function sportIcon(sport, options) {
|
|
|
137
260
|
}
|
|
138
261
|
/**
|
|
139
262
|
* A felt championship pennant with a stitched edge, lettered with its words and its year.
|
|
263
|
+
* @param options - The colours, words, year and view; every field is optional.
|
|
264
|
+
* @returns The pennant as a document of SVG.
|
|
140
265
|
* @example
|
|
141
266
|
* ```ts
|
|
142
267
|
* import { pennant } from "@johnmorrisdotca/dougu-sports/emblems";
|