It seems one can write Firestore rules that check that a value is of the duration type, like this:
allow write: if request.resource.data.bla is duration;
However, it's totally cryptic how to produce such a value, at least from the web APIs.
The Firestore Rules reference has a section for the duration namespace and the Duration interface.
It is even mentioned in this official Firebase video (link points to the exact time that the duration type is being talked about).
I had success testing in the Rules Playground writing a doc which had the value set to a <number>s pattern, e.g. 100s or 5s and even 0.5s, so I presumed that would map to an amount of seconds. I tried some other units, e.g. 1w (1 week) or 3d (3 days) or 5m (5 minutes), but no success.
Furthermore, none of these work locally in the Firestore emulator.
I understand that the duration type can be useful to validate e.g. timestamp inputs, but I wouldn't expect it to be accepted on its own (so there's no reason to have is duration compile) as it stands.
Am I missing something? Is this type meant to be hidden, unused, or...?