1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-07-31 13:44:28 +03:00

Switch to importing most things from the main matrix-js-sdk export (#11406)

* Switch to importing most things from the main matrix-js-sdk export

* fix imports

* Iterate

* Fix tests
This commit is contained in:
Michael Telatynski
2023-08-15 16:00:17 +01:00
committed by GitHub
parent 0842559fb2
commit ad73b0c16e
52 changed files with 262 additions and 277 deletions

View File

@ -15,10 +15,15 @@ limitations under the License.
*/
import { MockedObject } from "jest-mock";
import { makeBeaconInfoContent, makeBeaconContent } from "matrix-js-sdk/src/content-helpers";
import { MatrixClient, MatrixEvent, Beacon, getBeaconInfoIdentifier } from "matrix-js-sdk/src/matrix";
import {
MatrixClient,
MatrixEvent,
Beacon,
getBeaconInfoIdentifier,
ContentHelpers,
LocationAssetType,
} from "matrix-js-sdk/src/matrix";
import { M_BEACON, M_BEACON_INFO } from "matrix-js-sdk/src/@types/beacon";
import { LocationAssetType } from "matrix-js-sdk/src/@types/location";
import { getMockGeolocationPositionError } from "./location";
import { makeRoomWithStateEvents } from "./room";
@ -54,7 +59,7 @@ export const makeBeaconInfoEvent = (
room_id: roomId,
state_key: sender,
sender,
content: makeBeaconInfoContent(timeout, isLive, description, assetType, timestamp),
content: ContentHelpers.makeBeaconInfoContent(timeout, isLive, description, assetType, timestamp),
});
event.event.origin_server_ts = Date.now();
@ -97,7 +102,7 @@ export const makeBeaconEvent = (
type: M_BEACON.name,
room_id: roomId,
sender,
content: makeBeaconContent(geoUri, timestamp, beaconInfoId, description),
content: ContentHelpers.makeBeaconContent(geoUri, timestamp, beaconInfoId, description),
});
};

View File

@ -15,8 +15,7 @@ limitations under the License.
*/
import { LocationAssetType, M_LOCATION } from "matrix-js-sdk/src/@types/location";
import { makeLocationContent } from "matrix-js-sdk/src/content-helpers";
import { MatrixEvent, EventType } from "matrix-js-sdk/src/matrix";
import { MatrixEvent, EventType, ContentHelpers } from "matrix-js-sdk/src/matrix";
let id = 1;
export const makeLegacyLocationEvent = (geoUri: string): MatrixEvent => {
@ -35,7 +34,7 @@ export const makeLocationEvent = (geoUri: string, assetType?: LocationAssetType)
return new MatrixEvent({
event_id: `$${++id}`,
type: M_LOCATION.name,
content: makeLocationContent(
content: ContentHelpers.makeLocationContent(
`Found at ${geoUri} at 2021-12-21T12:22+0000`,
geoUri,
252523,

View File

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { OidcClientConfig } from "matrix-js-sdk/src/autodiscovery";
import { OidcClientConfig } from "matrix-js-sdk/src/matrix";
import { ValidatedIssuerMetadata } from "matrix-js-sdk/src/oidc/validate";
/**