我知道我可以做到这一点:
function (value: [boolean, string]) { const [boolValue, stringValue] = value; // make use of boolValue and stringValue }
// doesn't work function ([boolValue: boolean, stringValue: string]) { // make use of boolValue and stringValue }
好吧,我想出来了,不妨把答案贴出来。这是有效的:
function ([boolValue, stringValue]: [boolean, string]) { // make use of boolValue and stringValue }