Skip to content
This repository was archived by the owner on Nov 5, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/definition/messages/IMessage.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 { IRoom } from '../rooms';
import type { IBlock } from '../uikit';
Expand Down Expand Up @@ -26,7 +26,7 @@ export interface IMessage {
groupable?: boolean;
parseUrls?: boolean;
customFields?: { [key: string]: any };
blocks?: Array<IBlock | Block>;
blocks?: Array<IBlock | LayoutBlock>;
starred?: Array<{ _id: string }>;
pinned?: boolean;
pinnedAt?: Date;
Expand Down
4 changes: 2 additions & 2 deletions src/definition/uikit/IUIKitSurface.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Block, ButtonElement, TextObject } from '@rocket.chat/ui-kit';
import type { ButtonElement, LayoutBlock, TextObject } from '@rocket.chat/ui-kit';

import type { IBlock, IButtonElement, ITextObject } from './blocks';

Expand All @@ -13,7 +13,7 @@ export interface IUIKitSurface {
id: string;
type: UIKitSurfaceType;
title: ITextObject | TextObject;
blocks: Array<IBlock | Block>;
blocks: Array<IBlock | LayoutBlock>;
close?: IButtonElement | ButtonElement;
submit?: IButtonElement | ButtonElement;
state?: object;
Expand Down
6 changes: 3 additions & 3 deletions src/server/accessors/MessageBuilder.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 { IMessageBuilder } from '../../definition/accessors';
import type { IMessage, IMessageAttachment } from '../../definition/messages';
Expand Down Expand Up @@ -177,7 +177,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 @@ -191,7 +191,7 @@ export class MessageBuilder implements IMessageBuilder {
return this;
}

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
6 changes: 3 additions & 3 deletions src/server/misc/UIHelper.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 { v4 as uuid } from 'uuid';

import type { IBlock } from '../../definition/uikit';
Expand All @@ -10,8 +10,8 @@ export class UIHelper {
* @param appId the appId that will be assigned to
* @returns the array of block with the ids properties assigned
*/
public static assignIds(blocks: Array<IBlock | Block>, appId: string): Array<IBlock | Block> {
blocks.forEach((block: (IBlock | Block) & { appId?: string; blockId?: string; elements?: Array<any> }) => {
public static assignIds(blocks: Array<IBlock | LayoutBlock>, appId: string): Array<IBlock | LayoutBlock> {
blocks.forEach((block: (IBlock | LayoutBlock) & { appId?: string; blockId?: string; elements?: Array<any> }) => {
if (!block.appId) {
block.appId = appId;
}
Expand Down