Skip to content

Commit c00d166

Browse files
committed
Fixed lint/prettier errors
1 parent b5d5ca6 commit c00d166

File tree

7 files changed

+47
-32
lines changed

7 files changed

+47
-32
lines changed

src/extensions/EventSearchExtensionProjections.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export interface SearchResultItem {
55

66
export enum DirectionProjection {
77
Backward = "b",
8-
Forward = "f"
8+
Forward = "f",
99
}
1010

1111
export enum RelationsHelperEventProjection {
@@ -15,7 +15,7 @@ export enum RelationsHelperEventProjection {
1515
type AnyListener = (...args: any) => any;
1616
export type ListenerMap<E extends string> = { [eventName in E]: AnyListener };
1717

18-
export class TypedEventEmitter{}
18+
export class TypedEventEmitter {}
1919

2020
export interface IContentProjection {
2121
body: any;
@@ -24,7 +24,7 @@ export interface IContentProjection {
2424
export enum EventTypeProjection {}
2525

2626
export interface MatrixEventProjection {
27-
getType (): EventTypeProjection | string;
27+
getType(): EventTypeProjection | string;
2828
isRedacted(): boolean;
2929

3030
getContent<T extends IContentProjection = IContentProjection>(): T;
@@ -40,8 +40,11 @@ export interface IPaginateOptsProjection {
4040
}
4141

4242
export interface MatrixClientProjection {
43-
paginateEventTimeline(eventTimeline: EventTimelineProjection, opts: IPaginateOptsProjection): Promise<boolean>;
44-
processRoomEventsSearch<T extends ISearchResultsProjection>(searchResults: T, response: ISearchResponseProjection): T;
43+
paginateEventTimeline(eventTimeline: EventTimelineProjection, opts: IPaginateOptsProjection): Promise<boolean>;
44+
processRoomEventsSearch<T extends ISearchResultsProjection>(
45+
searchResults: T,
46+
response: ISearchResponseProjection,
47+
): T;
4548
}
4649

4750
export interface RoomMemberProjection {
@@ -61,7 +64,7 @@ export interface EventTimelineProjection {
6164
getEvents(): MatrixEventProjection[];
6265
}
6366

64-
export interface RoomProjection{
67+
export interface RoomProjection {
6568
getLiveTimeline(): EventTimelineProjection;
6669
}
6770

@@ -71,7 +74,7 @@ export interface IResultRoomEvents {
7174
results: ISearchResultProjection[];
7275
}
7376

74-
export interface IResultCategoriesProjection{
77+
export interface IResultCategoriesProjection {
7578
room_events: IResultRoomEvents;
7679
}
7780

@@ -104,4 +107,3 @@ export interface EventContextProjection {
104107

105108
getEvent(): MatrixEventProjection;
106109
}
107-

src/extensions/EventSearchExtensions.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,24 @@ export interface MatrixClientProjection {
88
* Public api surface used to consume the extension in client code
99
*/
1010
export interface ProvideEventSearchExtensions {
11-
eventSearch(client: MatrixClientProjection, term: string, roomId?: string, abortSignal?: AbortSignal): Promise<ISearchResultsProjection>;
11+
eventSearch(
12+
client: MatrixClientProjection,
13+
term: string,
14+
roomId?: string,
15+
abortSignal?: AbortSignal,
16+
): Promise<ISearchResultsProjection>;
1217
}
1318

1419
/**
1520
* Abstract base class which concrete extension implementations will extend/derive from
1621
*/
1722
export abstract class EventSearchExtensionsBase implements ProvideEventSearchExtensions {
18-
public abstract eventSearch(client: MatrixClientProjection, term: string, roomId?: string, abortSignal?: AbortSignal): Promise<ISearchResultsProjection>;
23+
public abstract eventSearch(
24+
client: MatrixClientProjection,
25+
term: string,
26+
roomId?: string,
27+
abortSignal?: AbortSignal,
28+
): Promise<ISearchResultsProjection>;
1929
}
2030

2131
/**
@@ -25,7 +35,12 @@ export abstract class EventSearchExtensionsBase implements ProvideEventSearchExt
2535
*
2636
* */
2737
export class DefaultEventSearchExtensions extends EventSearchExtensionsBase {
28-
public async eventSearch(client: MatrixClientProjection, term: string, roomId?: string, abortSignal?: AbortSignal): Promise<ISearchResultsProjection> {
38+
public async eventSearch(
39+
client: MatrixClientProjection,
40+
term: string,
41+
roomId?: string,
42+
abortSignal?: AbortSignal,
43+
): Promise<ISearchResultsProjection> {
2944
console.log("Default resolveSearchContext()");
3045
const searchResults: ISearchResultsProjection = {
3146
results: [],

src/extensions/ExtensionsManager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export class ExtensionsManager {
6363
public get eventSearchModule(): ProvideEventSearchExtensions {
6464
return this.eventSearchExtension;
6565
}
66-
66+
6767
/**
6868
* Provides an experimental extension.
6969
*
@@ -119,7 +119,7 @@ export class ExtensionsManager {
119119
);
120120
}
121121
}
122-
122+
123123
/* Add the experimental extension if any */
124124
if (module.extensions?.experimental) {
125125
if (this.hasDefaultExperimentalExtension) {

src/extensions/UserSearchExtensions.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,20 @@ export interface MatrixClientProjection {
9191
* Public api surface used to consume the extension in client code
9292
*/
9393
export interface ProvideUserSearchExtensions {
94-
getSearchContext(client: MatrixClientProjection | null, sdkContext: SdkContextClassProjection): Promise<SearchContext>;
94+
getSearchContext(
95+
client: MatrixClientProjection | null,
96+
sdkContext: SdkContextClassProjection,
97+
): Promise<SearchContext>;
9598
}
9699

97100
/**
98101
* Abstract base class which concrete extension implementations will extend/derive from
99102
*/
100103
export abstract class UserSearchExtensionsBase implements ProvideUserSearchExtensions {
101-
public abstract getSearchContext(client: MatrixClientProjection | null, sdkContextClass: SdkContextClassProjection): Promise<SearchContext>;
104+
public abstract getSearchContext(
105+
client: MatrixClientProjection | null,
106+
sdkContextClass: SdkContextClassProjection,
107+
): Promise<SearchContext>;
102108
}
103109

104110
/**
@@ -117,7 +123,10 @@ export interface SearchContext {
117123
*
118124
* */
119125
export class DefaultUserSearchExtensions extends UserSearchExtensionsBase {
120-
public async getSearchContext(client: MatrixClientProjection | null, sdkContext: SdkContextClassProjection): Promise<SearchContext> {
126+
public async getSearchContext(
127+
client: MatrixClientProjection | null,
128+
sdkContext: SdkContextClassProjection,
129+
): Promise<SearchContext> {
121130
console.log("Default resolveSearchContext()");
122131
return {
123132
extraBodyArgs: {},

test/extensions/UserSearchExtensions.test.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,20 @@ import {
2626
RoomProjection,
2727
SpaceStoreClassProjection,
2828
SearchContext,
29-
MatrixClientProjection
29+
MatrixClientProjection,
3030
} from "../../src/extensions/UserSearchExtensions";
3131

3232
import { DefaultExperimentalExtensions } from "../../src/extensions/ExperimentalExtensions";
3333

3434
function mockClient(): MatrixClientProjection {
3535
const cli = {} as MatrixClientProjection;
3636

37-
cli.getStateEvent = jest.fn( () => {
38-
return Promise.resolve(
39-
{} as Record<string, any>);
37+
cli.getStateEvent = jest.fn(() => {
38+
return Promise.resolve({} as Record<string, any>);
4039
});
4140
return cli;
4241
}
4342

44-
45-
46-
4743
describe("Defaults", () => {
4844
let module: RuntimeModule;
4945

tsconfig.build.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,5 @@
1010
"outDir": "./lib",
1111
"jsx": "react"
1212
},
13-
"include": [
14-
"./node_modules/matrix-js-sdk/src/@types/*.d.ts",
15-
"./src/**/*.ts", "./src/**/*.tsx"]
13+
"include": ["./node_modules/matrix-js-sdk/src/@types/*.d.ts", "./src/**/*.ts", "./src/**/*.tsx"]
1614
}

tsconfig.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,5 @@
1111
"strict": true,
1212
"skipLibCheck": true
1313
},
14-
"include": [
15-
"./node_modules/matrix-js-sdk/src/@types/*.d.ts",
16-
"./src/**/*.ts",
17-
"./src/**/*.tsx",
18-
"./test/**/*.ts"
19-
]
14+
"include": ["./node_modules/matrix-js-sdk/src/@types/*.d.ts", "./src/**/*.ts", "./src/**/*.tsx", "./test/**/*.ts"]
2015
}

0 commit comments

Comments
 (0)