Skip to content

Commit

Permalink
💡 Update JSDoc for buildBlock() and buildBlocks() functions
Browse files Browse the repository at this point in the history
  • Loading branch information
raycharius committed Jul 17, 2022
1 parent 4ef1bf0 commit eba0aad
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/utilities/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,18 @@ export function OptionGroupCollection(...optionGroups: Appendable<OptionGroupBui
return getBuiltCollection<OptionGroupBuilder, Readonly<SlackDto>>(...optionGroups);
}

/**
* @description Returns the block passed into the function as a built block, an object that conforms to the Slack API.
*/

export function buildBlock(block: BlockBuilder): Readonly<SlackBlockDto> {
return block.build();
}

/**
* @description Creates and returns an array of built blocks. Behaves in the same way as all appending methods, such as Surface.blocks().
*/

export function buildBlocks(...blocks: Appendable<BlockBuilder>): Readonly<SlackBlockDto>[] {
return getBuiltCollection<BlockBuilder, Readonly<SlackBlockDto>>(...blocks);
}
Expand Down

0 comments on commit eba0aad

Please sign in to comment.