Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #45 from xmtp/dj/screen-effect
Browse files Browse the repository at this point in the history
Export effect type
  • Loading branch information
daria-github authored Dec 19, 2023
2 parents c351a3f + 2afe634 commit 73797e1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
10 changes: 3 additions & 7 deletions experimental/content-type-screen-effect/src/ScreenEffect.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { Wallet } from "ethers";
import { Client } from "@xmtp/xmtp-js";
import {
ContentTypeScreenEffect,
EffectType,
ScreenEffectCodec,
} from "./ScreenEffect";
import { ContentTypeScreenEffect, ScreenEffectCodec } from "./ScreenEffect";
import type { ScreenEffect } from "./ScreenEffect";

describe("ScreenEffectContentType", () => {
Expand Down Expand Up @@ -38,7 +34,7 @@ describe("ScreenEffectContentType", () => {

const screenEffect: ScreenEffect = {
messageId: originalMessage.id,
effectType: EffectType.SNOW,
effectType: "SNOW",
};

await conversation.send(screenEffect, {
Expand All @@ -56,6 +52,6 @@ describe("ScreenEffectContentType", () => {
const messageContent = screenEffectMessage.content as ScreenEffect;

expect(messageContent.messageId).toBe(originalMessage.id);
expect(messageContent.effectType).toBe(EffectType.SNOW);
expect(messageContent.effectType).toBe("SNOW");
});
});
5 changes: 1 addition & 4 deletions experimental/content-type-screen-effect/src/ScreenEffect.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import { ContentTypeId } from "@xmtp/xmtp-js";
import type { ContentCodec, EncodedContent } from "@xmtp/xmtp-js";

export enum EffectType {
SNOW = "SNOW",
RAIN = "RAIN",
}
export type EffectType = "SNOW" | "RAIN";

export const ContentTypeScreenEffect = new ContentTypeId({
authorityId: "xmtp.org",
Expand Down
2 changes: 1 addition & 1 deletion experimental/content-type-screen-effect/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { ScreenEffectCodec, ContentTypeScreenEffect } from "./ScreenEffect";
export type { ScreenEffect } from "./ScreenEffect";
export type { ScreenEffect, EffectType } from "./ScreenEffect";

0 comments on commit 73797e1

Please sign in to comment.