Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

constructor

  • Parameters

    Returns StatsStore

Properties

Optional chunkFolder

chunkFolder: string

Optional chunks

chunks: Record<string, string[]>

fetchButtonsClicked

fetchButtonsClicked: () => Promise<void> = flow(function* (this: StatsStore) {if (process.env.PLUGIN_CTX === "pro") {/* onlypro:start */this.busyStats.buttonClicked = true;try {const dates = this.filters.dates.map((m) => m.format(DATE_FORMAT)) as [string, string];const result: ResponseRouteStatsButtonsClickedGet = yield request<RequestRouteStatsButtonsClickedGet,ParamsRouteStatsButtonsClickedGet,ResponseRouteStatsButtonsClickedGet>({location: locationRestStatsButtonsClickedGet,params: {from: dates[0],to: dates[1],context: this.filters.context}});this.stats.buttonsClicked = result;} catch (e) {console.log(e);throw e;} finally {this.busyStats.buttonClicked = false;}/* onlypro:end */} else {throw new Error("This feature is not available in the free version.");}})

Type declaration

    • (): Promise<void>
    • Returns Promise<void>

fetchCustomBypass

fetchCustomBypass: () => Promise<void> = flow(function* (this: StatsStore) {if (process.env.PLUGIN_CTX === "pro") {/* onlypro:start */this.busyStats.customBypass = true;try {const dates = this.filters.dates.map((m) => m.format(DATE_FORMAT)) as [string, string];const result: ResponseRouteStatsCustomBypassGet = yield request<RequestRouteStatsCustomBypassGet,ParamsRouteStatsCustomBypassGet,ResponseRouteStatsCustomBypassGet>({location: locationRestStatsCustomBypassGet,params: {from: dates[0],to: dates[1],context: this.filters.context}});this.stats.customBypass = result;} catch (e) {console.log(e);throw e;} finally {this.busyStats.customBypass = false;}/* onlypro:end */} else {throw new Error("This feature is not available in the free version.");}})

Type declaration

    • (): Promise<void>
    • Returns Promise<void>

fetchMain

fetchMain: () => Promise<void> = flow(function* (this: StatsStore) {if (process.env.PLUGIN_CTX === "pro") {/* onlypro:start */this.busyStats.main = true;try {const dates = this.filters.dates.map((m) => m.format(DATE_FORMAT)) as [string, string];const result: ResponseRouteStatsMainGet = yield request<RequestRouteStatsMainGet,ParamsRouteStatsMainGet,ResponseRouteStatsMainGet>({location: locationRestStatsMainGet,params: {from: dates[0],to: dates[1],context: this.filters.context}});this.stats.main = result;if (result.length > 0) {this.rootStore.checklistStore.probablyFetchByChangedItem("view-stats");}} catch (e) {console.log(e);throw e;} finally {this.busyStats.main = false;}/* onlypro:end */} else {throw new Error("This feature is not available in the free version.");}})

Type declaration

    • (): Promise<void>
    • Returns Promise<void>

filters

filters: { context: string; dates: [Moment, Moment] } = observable.object({dates: undefined,context: undefined},{},{ deep: false })

Type declaration

  • context: string
  • dates: [Moment, Moment]

Optional publicUrl

publicUrl: string

Optional restNamespace

restNamespace: string

Optional restNonce

restNonce: string

Optional restQuery

restQuery: {}

Type declaration

Optional restRecreateNonceEndpoint

restRecreateNonceEndpoint: string

Optional restRoot

restRoot: string

Optional restUrl

restUrl: string

Readonly rootStore

rootStore: RootStore

slug

slug: string

stats

stats: { buttonsClicked: ResponseRouteStatsButtonsClickedGet; customBypass: ResponseRouteStatsCustomBypassGet; main: ResponseRouteStatsMainGetEntry[] } = observable.object({main: undefined,buttonsClicked: undefined,customBypass: undefined},{},{ deep: false })

textDomain

textDomain: string

version

version: string

Methods

applyContext

  • applyContext(context: StatsStore["filters"]["context"]): void
  • This action does not actually refetch the stats, you need to act on your components!

    Parameters

    • context: StatsStore["filters"]["context"]

    Returns void

applyDates

  • applyDates(dates: StatsStore["filters"]["dates"]): void
  • This action does not actually refetch the stats, you need to act on your components!

    Parameters

    • dates: StatsStore["filters"]["dates"]

    Returns void

Static getPureSlug

  • getPureSlug(slug: string, camelCase?: boolean): string
  • Get the slug from the current process (webpack) instead of the PHP plugin output. For some cases you need to use that.

    Parameters

    • slug: string
    • Default value camelCase: boolean = false

    Returns string

Static slugCamelCase

  • slugCamelCase(slug: string): string
  • Convert a slug like "my-plugin" to "myPlugin". This can be useful for library naming (window[""] is bad because the hyphens).

    Parameters

    • slug: string

    Returns string

Object literals

busyStats

busyStats: object

buttonClicked

buttonClicked: boolean = false

customBypass

customBypass: boolean = false

main

main: boolean = false

Generated using TypeDoc