Skip to content

Commit

Permalink
chore: LayoutBlock (#774)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggazzo authored Jun 25, 2024
1 parent 3c0a7e4 commit 1f92cef
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions deno-runtime/lib/accessors/builders/MessageBuilder.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Block } from '@rocket.chat/ui-kit';
import { LayoutBlock } from '@rocket.chat/ui-kit';

import type { IMessageBuilder } from '@rocket.chat/apps-engine/definition/accessors/IMessageBuilder.ts';
import type { RocketChatAssociationModel as _RocketChatAssociationModel } from '@rocket.chat/apps-engine/definition/metadata/RocketChatAssociations.ts';
Expand Down Expand Up @@ -184,7 +184,7 @@ export class MessageBuilder implements IMessageBuilder {
return this.msg;
}

public addBlocks(blocks: BlockBuilder | Array<IBlock | Block>) {
public addBlocks(blocks: BlockBuilder | Array<IBlock | LayoutBlock>) {
if (!Array.isArray(this.msg.blocks)) {
this.msg.blocks = [];
}
Expand All @@ -198,7 +198,7 @@ export class MessageBuilder implements IMessageBuilder {
return this as IMessageBuilder;
}

public setBlocks(blocks: BlockBuilder | Array<IBlock | Block>) {
public setBlocks(blocks: BlockBuilder | Array<IBlock | LayoutBlock>) {
if (blocks instanceof BlockBuilder) {
this.msg.blocks = blocks.getBlocks();
} else {
Expand Down
8 changes: 4 additions & 4 deletions src/definition/accessors/IMessageBuilder.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Block } from '@rocket.chat/ui-kit';
import type { LayoutBlock } from '@rocket.chat/ui-kit';

import type { IMessage, IMessageAttachment } from '../messages';
import type { RocketChatAssociationModel } from '../metadata';
Expand Down Expand Up @@ -210,19 +210,19 @@ export interface IMessageBuilder {
* Adds a block collection to the message's
* own collection
*/
addBlocks(blocks: BlockBuilder | Array<IBlock | Block>): IMessageBuilder;
addBlocks(blocks: BlockBuilder | Array<IBlock | LayoutBlock>): IMessageBuilder;

/**
* Sets the block collection of the message
*
* @param blocks
*/
setBlocks(blocks: BlockBuilder | Array<IBlock | Block>): IMessageBuilder;
setBlocks(blocks: BlockBuilder | Array<IBlock | LayoutBlock>): IMessageBuilder;

/**
* Gets the block collection of the message
*/
getBlocks(): Array<IBlock | Block>;
getBlocks(): Array<IBlock | LayoutBlock>;

/**
* Adds a custom field to the message.
Expand Down
4 changes: 2 additions & 2 deletions src/server/messages/Message.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Block } from '@rocket.chat/ui-kit';
import type { LayoutBlock } from '@rocket.chat/ui-kit';

import type { IMessage, IMessageAttachment, IMessageFile, IMessageReactions } from '../../definition/messages';
import type { IUser, IUserLookup } from '../../definition/users';
Expand Down Expand Up @@ -40,7 +40,7 @@ export class Message implements IMessage {

public file?: IMessageFile;

public blocks?: Array<Block>;
public blocks?: Array<LayoutBlock>;

public starred?: Array<{ _id: string }>;

Expand Down

0 comments on commit 1f92cef

Please sign in to comment.