-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci]
- Loading branch information
1 parent
4d496e7
commit 62dbaf4
Showing
30 changed files
with
283 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import 'flarum/common/models/User'; | ||
|
||
import type Field from '../lib/models/Field'; | ||
import type Answer from '../lib/models/Answer'; | ||
|
||
declare module 'flarum/common/models/User' { | ||
export default interface User { | ||
bioFields(): Field[]; | ||
masqueradeAnswers(): Answer[]; | ||
canEditMasqueradeProfile(): boolean; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/// <reference types="flarum/@types/translator-icu-rich" /> | ||
export default class FieldEdit { | ||
view(vnode: any): JSX.Element; | ||
fieldItems(field: any, onUpdate: any): ItemList<any>; | ||
updateExistingFieldInput(what: any, field: any, value: any): void; | ||
deleteField(field: any, onUpdate: any): void; | ||
toggleField(e: any): void; | ||
submitAddField(field: any, onUpdate: any, e: any): void; | ||
updateExistingField(field: any, onUpdate: any): void; | ||
resetNewField(): void; | ||
newField: import("flarum/common/Model").default | undefined; | ||
readyToAdd(field: any): boolean; | ||
availableTypes(): { | ||
url: import("@askvortsov/rich-icu-message-formatter").NestedStringArray; | ||
email: import("@askvortsov/rich-icu-message-formatter").NestedStringArray; | ||
boolean: import("@askvortsov/rich-icu-message-formatter").NestedStringArray; | ||
select: import("@askvortsov/rich-icu-message-formatter").NestedStringArray; | ||
null: import("@askvortsov/rich-icu-message-formatter").NestedStringArray; | ||
}; | ||
} | ||
import ItemList from "flarum/common/utils/ItemList"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import type { Vnode } from 'mithril'; | ||
import type Field from '../../lib/models/Field'; | ||
interface FieldListAttrs { | ||
existing: Field[]; | ||
new: Field; | ||
loading: boolean; | ||
onUpdate: () => void; | ||
} | ||
export default class FieldList { | ||
view(vnode: Vnode<FieldListAttrs>): any; | ||
} | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
export default class MasqueradePage extends ExtensionPage<import("flarum/admin/components/ExtensionPage").ExtensionPageAttrs> { | ||
constructor(); | ||
oninit(vnode: any): void; | ||
existing: any[] | import("flarum/common/Model").default[] | undefined; | ||
enforceProfileCompletion: string | boolean | undefined; | ||
config(): void; | ||
oncreate(vnode: any): void; | ||
onupdate(): void; | ||
content(): any; | ||
updateSort(sorting: any): void; | ||
requestSuccess(): void; | ||
loadExisting(): Promise<void>; | ||
resetNew(): void; | ||
newField: import("flarum/common/Model").default | undefined; | ||
} | ||
import ExtensionPage from "flarum/admin/components/ExtensionPage"; |
13 changes: 13 additions & 0 deletions
13
js/dist-typings/admin/components/SelectFieldOptionEditor.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export default class SelectFieldOptionEditor extends Component<any, undefined> { | ||
constructor(); | ||
oninit(vnode: any): void; | ||
newOption: any; | ||
view(): any; | ||
updateRules(options: any): void; | ||
options(): any[]; | ||
updateOption(index: any, value: any): void; | ||
moveOption(index: any, moveIndex: any): void; | ||
deleteOption(index: any): void; | ||
addOption(): void; | ||
} | ||
import Component from "flarum/common/Component"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import FieldEdit from './FieldEdit'; | ||
import FieldList from './FieldList'; | ||
import MasqueradePage from './MasqueradePage'; | ||
import SelectFieldOptionEditor from './SelectFieldOptionEditor'; | ||
export declare const components: { | ||
FieldList: typeof FieldList; | ||
FieldEdit: typeof FieldEdit; | ||
MasqueradePage: typeof MasqueradePage; | ||
SelectFieldOptionEditor: typeof SelectFieldOptionEditor; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
declare const _default: import("flarum/common/extenders/Store").default[]; | ||
export default _default; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { default as extend } from './extend'; | ||
export * from './components'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
declare const _default: import("flarum/common/extenders/Store").default[]; | ||
export default _default; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default function addProfilePane(): void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
declare const _default: (import("flarum/common/extenders/Store").default | import("flarum/common/extenders/Model").default)[]; | ||
export default _default; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export { default as extend } from './extend'; | ||
export * from './panes'; | ||
export * from './types'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default function mutateUserHero(): void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export default class ProfileConfigurePane extends Component<any, undefined> { | ||
constructor(); | ||
oninit(vnode: any): void; | ||
loading: boolean | undefined; | ||
enforceProfileCompletion: {} | undefined; | ||
profileCompleted: boolean | {} | undefined; | ||
profileNowCompleted: boolean | undefined; | ||
answers: any; | ||
answerValues: {} | undefined; | ||
user: any; | ||
dirty: boolean | undefined; | ||
view(): JSX.Element; | ||
field(field: any): JSX.Element; | ||
load(): void; | ||
set(field: any, value: any): void; | ||
update(e: any): void; | ||
parseResponse(response: any): void; | ||
} | ||
import Component from "flarum/common/Component"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import Component, { ComponentAttrs } from 'flarum/common/Component'; | ||
import type Answer from '../../lib/models/Answer'; | ||
import type Field from 'src/lib/models/Field'; | ||
import type User from 'flarum/common/models/User'; | ||
import type Mithril from 'mithril'; | ||
export interface ProfilePaneAttrs extends ComponentAttrs { | ||
answers: Answer[]; | ||
user: User; | ||
loading: boolean; | ||
} | ||
export default class ProfilePane extends Component<ProfilePaneAttrs> { | ||
answers: Answer[]; | ||
user: User; | ||
loading: boolean; | ||
oninit(vnode: Mithril.Vnode): void; | ||
view(): JSX.Element; | ||
field(field: Field, content: Answer | null): JSX.Element; | ||
load(): Promise<void>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import UserPage from 'flarum/forum/components/UserPage'; | ||
import type User from 'flarum/common/models/User'; | ||
import type Mithril from 'mithril'; | ||
export default class RootMasqueradePane extends UserPage { | ||
loading: boolean; | ||
oninit(vnode: Mithril.Vnode): void; | ||
pageContentComponent(): JSX.Element | null; | ||
show(user: User): void; | ||
content(): JSX.Element; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import ProfileConfigurePane from './ProfileConfigurePane'; | ||
import ProfilePane from './ProfilePane'; | ||
import RootMasqueradePane from './RootMasqueradePane'; | ||
export declare const panes: { | ||
ProfileConfigurePane: typeof ProfileConfigurePane; | ||
ProfilePane: typeof ProfilePane; | ||
RootMasqueradePane: typeof RootMasqueradePane; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
export default class BaseField { | ||
static isNoOptionSelectedValue(value: any): boolean; | ||
constructor({ field, set, value }: { | ||
field: any; | ||
set: any; | ||
value: any; | ||
}); | ||
field: any; | ||
set: any; | ||
value: any; | ||
readAttribute(object: any, attribute: any): any; | ||
/** | ||
* Gets all Laravel validation rules split by rule | ||
* @returns {Array} | ||
*/ | ||
validationRules(): any[]; | ||
/** | ||
* Gets a Laravel validation rule by name | ||
* @param {string} ruleName | ||
* @returns {string|null} | ||
*/ | ||
validationRule(ruleName: string): string | null; | ||
editorField(): JSX.Element; | ||
editorInput(): JSX.Element; | ||
editorInputAttrs(): { | ||
className: string; | ||
oninput: (event: any) => void; | ||
value: any; | ||
required: any; | ||
}; | ||
answerField(): JSX.Element; | ||
answerContent(): any; | ||
hasAnswer(): boolean; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export default class BooleanField extends BaseField { | ||
editorInput(): any[]; | ||
options(): ({ | ||
selected: {}; | ||
key: null; | ||
label: any; | ||
} | { | ||
selected: {}; | ||
key: string; | ||
label: any; | ||
} | { | ||
selected: () => boolean; | ||
key: any; | ||
label: string; | ||
})[]; | ||
answerContent(): any[] | ""; | ||
} | ||
import BaseField from "./BaseField"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export default class EmailField extends BaseField { | ||
mailTo(): void; | ||
} | ||
import BaseField from "./BaseField"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export default class SelectField extends BaseField { | ||
editorInput(): Mithril.Vnode; | ||
options(): {}; | ||
} | ||
import BaseField from "./BaseField"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
export default class TypeFactory { | ||
static typeForField({ field, set, value }: { | ||
field: any; | ||
set?: undefined; | ||
value: any; | ||
}): BaseField; | ||
static fieldAttribute(field: any, attribute: any): any; | ||
static types(): { | ||
boolean: typeof BooleanField; | ||
email: typeof EmailField; | ||
select: typeof SelectField; | ||
url: typeof UrlField; | ||
}; | ||
/** | ||
* Identifies how to parse the field answer. | ||
* @returns {null|string} | ||
*/ | ||
static identify(field: any): null | string; | ||
} | ||
import BaseField from "./BaseField"; | ||
import BooleanField from "./BooleanField"; | ||
import EmailField from "./EmailField"; | ||
import SelectField from "./SelectField"; | ||
import UrlField from "./UrlField"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export default class UrlField extends BaseField { | ||
to(): void; | ||
} | ||
import BaseField from "./BaseField"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import BaseField from './BaseField'; | ||
import BooleanField from './BooleanField'; | ||
import EmailField from './EmailField'; | ||
import SelectField from './SelectField'; | ||
import TypeFactory from './TypeFactory'; | ||
import UrlField from './UrlField'; | ||
export declare const types: { | ||
BaseField: typeof BaseField; | ||
BooleanField: typeof BooleanField; | ||
EmailField: typeof EmailField; | ||
SelectField: typeof SelectField; | ||
TypeFactory: typeof TypeFactory; | ||
UrlField: typeof UrlField; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import Model from 'flarum/common/Model'; | ||
import type Field from './Field'; | ||
export default class Answer extends Model { | ||
content: () => unknown; | ||
fieldId: () => unknown; | ||
field: () => Field; | ||
userId: () => unknown; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export default class Field extends Model { | ||
name: () => any; | ||
description: () => any; | ||
type: () => any; | ||
validation: () => any; | ||
required: () => any; | ||
prefix: () => any; | ||
icon: () => any; | ||
sort: () => any; | ||
deleted_at: () => Date | null | undefined; | ||
answer: () => false | Model; | ||
on_bio: () => any; | ||
} | ||
import Model from "flarum/common/Model"; |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.