mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-22 20:39:17 +08:00
23 lines
691 B
TypeScript
23 lines
691 B
TypeScript
import Subsume = require('subsume');
|
|
|
|
const subsume = new Subsume();
|
|
new Subsume('foo');
|
|
|
|
subsume.id; // $ExpectType string
|
|
subsume.prefix; // $ExpectType string
|
|
subsume.postfix; // $ExpectType string
|
|
subsume.regex; // $ExpectType RegExp
|
|
|
|
const text = subsume.compose('🦄');
|
|
text; // $ExpectType string
|
|
|
|
const output = `some${text} random text`;
|
|
|
|
const res = subsume.parse(output);
|
|
res; // $ExpectType ParseResult
|
|
res.data; // $ExpectType string | undefined
|
|
res.rest; // $ExpectType string
|
|
|
|
const input = 'some@@[7febcd0b3806fbc48c01d7cea4ed1219]@@🦄##[7febcd0b3806fbc48c01d7cea4ed1219]## random text';
|
|
Subsume.parse(text, '7febcd0b3806fbc48c01d7cea4ed1219'); // $ExpectType ParseResult
|