``` ~/go/bin/sourcemapper -output ddb -jsurl https://media.dndbeyond.com/character-app/static/js/main.90aa78c5.js ```
27 lines
712 B
TypeScript
27 lines
712 B
TypeScript
import { createSelector } from "reselect";
|
|
|
|
import {
|
|
DecorationUtils,
|
|
rulesEngineSelectors,
|
|
} from "@dndbeyond/character-rules-engine/es";
|
|
import { IRollContext } from "@dndbeyond/dice";
|
|
|
|
import { appEnvSelectors } from "./index";
|
|
|
|
export const getCharacterRollContext = createSelector(
|
|
[
|
|
appEnvSelectors.getCharacterId,
|
|
rulesEngineSelectors.getName,
|
|
rulesEngineSelectors.getDecorationInfo,
|
|
],
|
|
(characterId, name, decorationInfo): IRollContext => {
|
|
return {
|
|
entityId: characterId ? characterId.toString() : "",
|
|
entityType: "character",
|
|
name: name?.toString(),
|
|
avatarUrl:
|
|
DecorationUtils.getAvatarInfo(decorationInfo).avatarUrl?.toString(),
|
|
};
|
|
}
|
|
);
|